Added return values to the CDC and MIDI class driver transmit functions.
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / MIDI.c
index 76583b1..79d9e74 100644 (file)
@@ -70,18 +70,24 @@ void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)
 \r
 }\r
 \r
-void MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo, MIDI_EventPacket_t* const Event)\r
+uint8_t MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo, MIDI_EventPacket_t* const Event)\r
 {\r
        if (USB_DeviceState != DEVICE_STATE_Configured)\r
-         return;\r
+         return ENDPOINT_RWSTREAM_NoError;\r
        \r
        Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpointNumber);\r
 \r
        if (Endpoint_IsReadWriteAllowed());\r
        {\r
-               Endpoint_Write_Stream_LE(Event, sizeof(Event), NO_STREAM_CALLBACK);\r
+               uint8_t ErrorCode;\r
+\r
+               if ((ErrorCode = Endpoint_Write_Stream_LE(Event, sizeof(Event), NO_STREAM_CALLBACK)) != ENDPOINT_RWSTREAM_NoError)\r
+                 return ErrorCode;\r
+\r
                Endpoint_ClearIN();\r
        }\r
+       \r
+       return ENDPOINT_RWSTREAM_NoError;\r
 }\r
 \r
 bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo, MIDI_EventPacket_t* const Event)\r