Removed new Start of Frame event from the library; performance suffered far too much...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / MIDI.c
index 9b4cd4b..42c0690 100644 (file)
@@ -55,36 +55,18 @@ bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
        return true;\r
 }\r
 \r
-void USB_MIDI_SendNoteChange(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, const uint8_t Pitch, const bool OnOff,\r
-                             const uint8_t CableID, const uint8_t Channel)\r
-{\r
-       if (!(USB_IsConnected))\r
-         return;\r
-       \r
-       Endpoint_SelectEndpoint(MIDIInterfaceInfo->DataINEndpointNumber);\r
-       while (!(Endpoint_IsReadWriteAllowed()));\r
-\r
-       uint8_t Command = ((OnOff)? MIDI_COMMAND_NOTE_ON : MIDI_COMMAND_NOTE_OFF);\r
-\r
-       Endpoint_Write_Byte((CableID << 4) | (Command >> 4));\r
-\r
-       Endpoint_Write_Byte(Command | Channel);\r
-       Endpoint_Write_Byte(Pitch);\r
-       Endpoint_Write_Byte(MIDI_STANDARD_VELOCITY);\r
-       \r
-       Endpoint_ClearIN();\r
-}\r
-\r
 void USB_MIDI_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event)\r
 {\r
        if (!(USB_IsConnected))\r
          return;\r
        \r
        Endpoint_SelectEndpoint(MIDIInterfaceInfo->DataINEndpointNumber);\r
-       while (!(Endpoint_IsReadWriteAllowed()));\r
 \r
-       Endpoint_Write_Stream_LE(Event, sizeof(USB_MIDI_EventPacket_t), NO_STREAM_CALLBACK);\r
-       Endpoint_ClearIN();\r
+       if (Endpoint_IsReadWriteAllowed());\r
+       {\r
+               Endpoint_Write_Stream_LE(Event, sizeof(USB_MIDI_EventPacket_t), NO_STREAM_CALLBACK);\r
+               Endpoint_ClearIN();\r
+       }\r
 }\r
 \r
 bool USB_MIDI_ReceiveEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event)\r