diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-06-02 10:54:32 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-06-02 10:54:32 +0000 |
commit | 7c5444b89a49df7cb671b0b041567990d2a3012e (patch) | |
tree | 481a5b56d9f360773112b00761aa430d8121d976 /LUFA/Drivers/USB/Class/Device/MIDI.c | |
parent | 74b7c07e96562158de294f92baed4c83b4fce970 (diff) | |
download | lufa-7c5444b89a49df7cb671b0b041567990d2a3012e.tar.gz lufa-7c5444b89a49df7cb671b0b041567990d2a3012e.tar.bz2 lufa-7c5444b89a49df7cb671b0b041567990d2a3012e.zip |
Removed new Start of Frame event from the library; performance suffered far too much and it was only useful in one of the standard classes (HID). Altered HID demos to use the previous method of tracking millisecond periods via a hardware timer rather than the SOF events.
Fixed MIDI class driver blocking on unread events to the host.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device/MIDI.c')
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/MIDI.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/MIDI.c b/LUFA/Drivers/USB/Class/Device/MIDI.c index 9b4cd4b04..42c06904b 100644 --- a/LUFA/Drivers/USB/Class/Device/MIDI.c +++ b/LUFA/Drivers/USB/Class/Device/MIDI.c @@ -55,36 +55,18 @@ bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo) return true;
}
-void USB_MIDI_SendNoteChange(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, const uint8_t Pitch, const bool OnOff,
- const uint8_t CableID, const uint8_t Channel)
-{
- if (!(USB_IsConnected))
- return;
-
- Endpoint_SelectEndpoint(MIDIInterfaceInfo->DataINEndpointNumber);
- while (!(Endpoint_IsReadWriteAllowed()));
-
- uint8_t Command = ((OnOff)? MIDI_COMMAND_NOTE_ON : MIDI_COMMAND_NOTE_OFF);
-
- Endpoint_Write_Byte((CableID << 4) | (Command >> 4));
-
- Endpoint_Write_Byte(Command | Channel);
- Endpoint_Write_Byte(Pitch);
- Endpoint_Write_Byte(MIDI_STANDARD_VELOCITY);
-
- Endpoint_ClearIN();
-}
-
void USB_MIDI_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event)
{
if (!(USB_IsConnected))
return;
Endpoint_SelectEndpoint(MIDIInterfaceInfo->DataINEndpointNumber);
- while (!(Endpoint_IsReadWriteAllowed()));
- Endpoint_Write_Stream_LE(Event, sizeof(USB_MIDI_EventPacket_t), NO_STREAM_CALLBACK);
- Endpoint_ClearIN();
+ if (Endpoint_IsReadWriteAllowed());
+ {
+ Endpoint_Write_Stream_LE(Event, sizeof(USB_MIDI_EventPacket_t), NO_STREAM_CALLBACK);
+ Endpoint_ClearIN();
+ }
}
bool USB_MIDI_ReceiveEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event)
|