diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-11-03 03:20:08 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-11-03 03:20:08 +0000 |
commit | ee495ca5002da26bae51a95d1922474708a2e818 (patch) | |
tree | 97380d53164b47f3a36b8234aa9ec536c79c5ef1 /LUFA/Drivers/USB/Class/Host | |
parent | 5ce8380a7d076b5368d9800ff1aab89ba0487276 (diff) | |
download | lufa-ee495ca5002da26bae51a95d1922474708a2e818.tar.gz lufa-ee495ca5002da26bae51a95d1922474708a2e818.tar.bz2 lufa-ee495ca5002da26bae51a95d1922474708a2e818.zip |
Fixed MIDI class driver send routines silently discarding packets if the endpoint or pipe is busy (thanks to Robin Green).
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host')
-rw-r--r-- | LUFA/Drivers/USB/Class/Host/MIDI.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/MIDI.c b/LUFA/Drivers/USB/Class/Host/MIDI.c index ad6c5cfd8..87e429010 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDI.c +++ b/LUFA/Drivers/USB/Class/Host/MIDI.c @@ -179,18 +179,15 @@ uint8_t MIDI_Host_SendEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterface if ((USB_HostState != HOST_STATE_Configured) || !(MIDIInterfaceInfo->State.IsActive)) return HOST_SENDCONTROL_DeviceDisconnected; + uint8_t ErrorCode; + Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipeNumber); - if (Pipe_IsReadWriteAllowed()) - { - uint8_t ErrorCode; + if ((ErrorCode = Pipe_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError) + return ErrorCode; - if ((ErrorCode = Pipe_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError) - return ErrorCode; - - if (!(Pipe_IsReadWriteAllowed())) - Pipe_ClearOUT(); - } + if (!(Pipe_IsReadWriteAllowed())) + Pipe_ClearOUT(); return PIPE_RWSTREAM_NoError; } |