diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-11-05 03:43:11 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-11-05 03:43:11 +0000 |
| commit | ab85f1b761975f3e4dfe687ffc4a5f862bc1608e (patch) | |
| tree | e2ec634f9434253203e0e34765688f4c2baec1ca /Demos/Host/LowLevel | |
| parent | fc31371b629cf7353dcc4f2443ee492870516c57 (diff) | |
Loop in the ClassDriver MIDI device/host demos until there are no more incomming events to process. Only clear the endpoint/pipe bank in the LowLevel MIDI device/host demos when the endpoint is empty after an event read.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1555 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos/Host/LowLevel')
| -rw-r--r-- | Demos/Host/LowLevel/MIDIHost/MIDIHost.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c index b616b679..5ff3baa3 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c @@ -192,19 +192,19 @@ void MIDI_Host_Task(void) ((MIDIEvent.Data1 & 0x0F) + 1), MIDIEvent.Data2, MIDIEvent.Data3); } - - Pipe_ClearIN(); + + if (!(Pipe_BytesInPipe())) + Pipe_ClearIN(); } Pipe_SelectPipe(MIDI_DATA_OUT_PIPE); - static uint8_t PrevJoystickStatus; - if (Pipe_IsOUTReady()) { uint8_t MIDICommand = 0; uint8_t MIDIPitch; + static uint8_t PrevJoystickStatus; uint8_t JoystickStatus = Joystick_GetStatus(); uint8_t JoystickChanges = (JoystickStatus ^ PrevJoystickStatus); |
