X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/cb779e3d7d32d7c43e0a45bb526de0a04135b0c7..ec537fd84d6ad3fd0dfa1b55efa2c2d554c1db48:/Demos/Device/LowLevel/MIDI/MIDI.c?ds=sidebyside 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(); + } } }