Skip to content

Commit

Permalink
Merge pull request #21 from kmcgain/master
Browse files Browse the repository at this point in the history
Reset sysex buffer index to 0 if sysex start byte encountered before sysex end byte (ie drop truncated message)
  • Loading branch information
tysonlt authored Oct 17, 2020
2 parents daf3264 + f934b6e commit 1d95a37
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/interface/private/AxeSystem_Midi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ void AxeSystem::readMidi() {
byte data = SER_READ;

if (_readingSysex) {
if (data == SystemExclusive)
_sysexCount = 0;

_sysexBuffer[_sysexCount++] = data;
if (data == SYSEX_END) {
_readingSysex = false;

if (validateSysEx(_sysexBuffer, _sysexCount)) {
onSystemExclusive(_sysexBuffer, _sysexCount);
} else {
Expand Down

0 comments on commit 1d95a37

Please sign in to comment.