X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/85cf2027373cfbe6f6fb257a84a59df0d74f3e1a..99a9e415efd1e27d902427ccd1aa6e4a9f9d4d05:/Demos/Device/LowLevel/MIDI/MIDI.c?ds=inline diff --git a/Demos/Device/LowLevel/MIDI/MIDI.c b/Demos/Device/LowLevel/MIDI/MIDI.c index e43645585..bfe90b0d1 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.c +++ b/Demos/Device/LowLevel/MIDI/MIDI.c @@ -204,8 +204,12 @@ void MIDI_Task(void) LEDs_SetAllLEDs(LEDS_NO_LEDS); } - /* Clear the endpoint ready for new packet */ - Endpoint_ClearOUT(); + /* If the endpoint is now empty, clear the bank */ + if (!(Endpoint_BytesInEndpoint())) + { + /* Clear the endpoint ready for new packet */ + Endpoint_ClearOUT(); + } } }