Skip to content

Conversation

@nomakewan
Copy link

@nomakewan nomakewan commented Sep 11, 2023

These changes resolve the compilation errors in the Arduino IDE by discarding an unnecessary variable from flush() and explicitly typecasting trk from int to uint16_t for the comparison operation in isTrackPlaying(int trk).

Additionally this PR corrects an out-of-bounds character array issue in the getVersion() function that was double-dipping the version character array cleaning process which was already handled sufficiently by update(). Resolves #28

This PR also adds a define for the Arduino Due to include Arduino.h for serial ports rather than HardwareSerial.h, which Resolves #16

Finally, this PR changes the hardcoded path to AltSoftSerial's header file to use the Arduino Library instead, which simplifies sketches and Resolves #18

These changes resolve the compilation errors in the Arduino IDE by discarding an unnecessary variable from flush() and explicitly typecasting trk from int to uint16_t for the comparison operation in isTrackPlaying(int trk).
This corrects an out-of-bounds character array issue which can occur when calling getVersion, due to an unnecessary prefix increment which is already handled by the update function.
@nomakewan nomakewan changed the title Silence compilation errors Silence compilation errors, correct array bounds issue Sep 11, 2023
Missed the erroneous break statement which is unnecessary since update() already handled the bounds checking and version array cleaning.
This corrects errors related to AltSoftSerial, enforcing the use of the standard Arduino Library for it rather than a hardcoded path to its header file. It also updates the README accordingly.
@nomakewan nomakewan changed the title Silence compilation errors, correct array bounds issue Compilation warning fixes, small bugfixes Sep 11, 2023
Fixes newly-created compiler error due to removing the unused parameter from getVersion.
Updates the README to match the current code of this PR.
Checks to see if the user's board is a Due or its derivatives and if so includes Arduino.h instead of HardwareSerial.h since that is where the serial ports are defined on the Due.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wTrig.getVersion() array overrun Issue Error using the Wav TRigger Arduino Serial Library #define WTSerial Serial1

1 participant