forked from mfulz_github/qmk_firmware
Fixed MIDI class driver send routines silently discarding packets if the endpoint or pipe is busy (thanks to Robin Green).
This commit is contained in:
parent
5ce8380a7d
commit
ee495ca500
|
@ -92,18 +92,15 @@ uint8_t MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInter
|
||||||
if (USB_DeviceState != DEVICE_STATE_Configured)
|
if (USB_DeviceState != DEVICE_STATE_Configured)
|
||||||
return ENDPOINT_RWSTREAM_DeviceDisconnected;
|
return ENDPOINT_RWSTREAM_DeviceDisconnected;
|
||||||
|
|
||||||
|
uint8_t ErrorCode;
|
||||||
|
|
||||||
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpointNumber);
|
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpointNumber);
|
||||||
|
|
||||||
if (Endpoint_IsReadWriteAllowed())
|
if ((ErrorCode = Endpoint_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NO_STREAM_CALLBACK)) != ENDPOINT_RWSTREAM_NoError)
|
||||||
{
|
return ErrorCode;
|
||||||
uint8_t ErrorCode;
|
|
||||||
|
|
||||||
if ((ErrorCode = Endpoint_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NO_STREAM_CALLBACK)) != ENDPOINT_RWSTREAM_NoError)
|
if (!(Endpoint_IsReadWriteAllowed()))
|
||||||
return ErrorCode;
|
Endpoint_ClearIN();
|
||||||
|
|
||||||
if (!(Endpoint_IsReadWriteAllowed()))
|
|
||||||
Endpoint_ClearIN();
|
|
||||||
}
|
|
||||||
|
|
||||||
return ENDPOINT_RWSTREAM_NoError;
|
return ENDPOINT_RWSTREAM_NoError;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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))
|
if ((USB_HostState != HOST_STATE_Configured) || !(MIDIInterfaceInfo->State.IsActive))
|
||||||
return HOST_SENDCONTROL_DeviceDisconnected;
|
return HOST_SENDCONTROL_DeviceDisconnected;
|
||||||
|
|
||||||
|
uint8_t ErrorCode;
|
||||||
|
|
||||||
Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipeNumber);
|
Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipeNumber);
|
||||||
|
|
||||||
if (Pipe_IsReadWriteAllowed())
|
if ((ErrorCode = Pipe_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
|
||||||
{
|
return ErrorCode;
|
||||||
uint8_t ErrorCode;
|
|
||||||
|
|
||||||
if ((ErrorCode = Pipe_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
|
if (!(Pipe_IsReadWriteAllowed()))
|
||||||
return ErrorCode;
|
Pipe_ClearOUT();
|
||||||
|
|
||||||
if (!(Pipe_IsReadWriteAllowed()))
|
|
||||||
Pipe_ClearOUT();
|
|
||||||
}
|
|
||||||
|
|
||||||
return PIPE_RWSTREAM_NoError;
|
return PIPE_RWSTREAM_NoError;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,6 +92,7 @@
|
||||||
* - Fixed ISR definition conflict in the XPLAIN bridge between the software UART and the AVRISP-MKII ISP modules
|
* - Fixed ISR definition conflict in the XPLAIN bridge between the software UART and the AVRISP-MKII ISP modules
|
||||||
* - Fixed random enumeration failure while in device mode due to interrupts causing the Set Address request to exceed maximum timings
|
* - Fixed random enumeration failure while in device mode due to interrupts causing the Set Address request to exceed maximum timings
|
||||||
* - Fixed MIDI_Host_Flush() not aborting early when the specified MIDI host interface was not configured
|
* - Fixed MIDI_Host_Flush() not aborting early when the specified MIDI host interface was not configured
|
||||||
|
* - Fixed MIDI class driver send routines silently discarding packets if the endpoint or pipe is busy (thanks to Robin Green)
|
||||||
*
|
*
|
||||||
* \section Sec_ChangeLog100807 Version 100807
|
* \section Sec_ChangeLog100807 Version 100807
|
||||||
* <b>New:</b>
|
* <b>New:</b>
|
||||||
|
|
Loading…
Reference in New Issue