Add branch for the conversion of demos to use standard C header files for configuration, rather than makefile defined macros.
This commit is contained in:
parent
e8570c4a37
commit
359fbfe14d
395 changed files with 9912 additions and 2756 deletions
|
@ -41,38 +41,14 @@ bool MIDI_Device_ConfigureEndpoints(USB_ClassInfo_MIDI_Device_t* const MIDIInter
|
|||
{
|
||||
memset(&MIDIInterfaceInfo->State, 0x00, sizeof(MIDIInterfaceInfo->State));
|
||||
|
||||
for (uint8_t EndpointNum = 1; EndpointNum < ENDPOINT_TOTAL_ENDPOINTS; EndpointNum++)
|
||||
{
|
||||
uint16_t Size;
|
||||
uint8_t Type;
|
||||
uint8_t Direction;
|
||||
bool DoubleBanked;
|
||||
MIDIInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_BULK;
|
||||
MIDIInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_BULK;
|
||||
|
||||
if (EndpointNum == MIDIInterfaceInfo->Config.DataINEndpointNumber)
|
||||
{
|
||||
Size = MIDIInterfaceInfo->Config.DataINEndpointSize;
|
||||
Direction = ENDPOINT_DIR_IN;
|
||||
Type = EP_TYPE_BULK;
|
||||
DoubleBanked = MIDIInterfaceInfo->Config.DataINEndpointDoubleBank;
|
||||
}
|
||||
else if (EndpointNum == MIDIInterfaceInfo->Config.DataOUTEndpointNumber)
|
||||
{
|
||||
Size = MIDIInterfaceInfo->Config.DataOUTEndpointSize;
|
||||
Direction = ENDPOINT_DIR_OUT;
|
||||
Type = EP_TYPE_BULK;
|
||||
DoubleBanked = MIDIInterfaceInfo->Config.DataOUTEndpointDoubleBank;
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!(Endpoint_ConfigureEndpointTable(&MIDIInterfaceInfo->Config.DataINEndpoint, 1)))
|
||||
return false;
|
||||
|
||||
if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
|
||||
DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!(Endpoint_ConfigureEndpointTable(&MIDIInterfaceInfo->Config.DataOUTEndpoint, 1)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -95,7 +71,7 @@ uint8_t MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInter
|
|||
|
||||
uint8_t ErrorCode;
|
||||
|
||||
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpointNumber);
|
||||
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpoint.Address);
|
||||
|
||||
if ((ErrorCode = Endpoint_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NULL)) != ENDPOINT_RWSTREAM_NoError)
|
||||
return ErrorCode;
|
||||
|
@ -113,7 +89,7 @@ uint8_t MIDI_Device_Flush(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)
|
|||
|
||||
uint8_t ErrorCode;
|
||||
|
||||
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpointNumber);
|
||||
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpoint.Address);
|
||||
|
||||
if (Endpoint_BytesInEndpoint())
|
||||
{
|
||||
|
@ -132,7 +108,7 @@ bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInter
|
|||
if (USB_DeviceState != DEVICE_STATE_Configured)
|
||||
return false;
|
||||
|
||||
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataOUTEndpointNumber);
|
||||
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataOUTEndpoint.Address);
|
||||
|
||||
if (!(Endpoint_IsReadWriteAllowed()))
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue