/*
LUFA Library
- Copyright (C) Dean Camera, 2013.
+ Copyright (C) Dean Camera, 2014.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
MIDIInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
MIDIInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
MIDIInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_BULK;
-
+
MIDIInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
MIDIInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
MIDIInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
-
+
if (!(Pipe_ConfigurePipeTable(&MIDIInterfaceInfo->Config.DataINPipe, 1)))
return false;
-
+
if (!(Pipe_ConfigurePipeTable(&MIDIInterfaceInfo->Config.DataOUTPipe, 1)))
- return false;
+ return false;
MIDIInterfaceInfo->State.InterfaceNumber = MIDIInterface->InterfaceNumber;
MIDIInterfaceInfo->State.IsActive = true;
Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
-
+
if (Pipe_BytesInPipe())
{
Pipe_ClearOUT();
Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
-
+
if ((ErrorCode = Pipe_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NULL)) != PIPE_RWSTREAM_NoError)
{
Pipe_Freeze();
{
if ((USB_HostState != HOST_STATE_Configured) || !(MIDIInterfaceInfo->State.IsActive))
return HOST_SENDCONTROL_DeviceDisconnected;
-
+
bool DataReady = false;
Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataINPipe.Address);
if (!(Pipe_BytesInPipe()))
Pipe_ClearIN();
}
-
+
Pipe_Freeze();
-
+
return DataReady;
}