Ensure all USB device class drivers have the same three main functions as their interface for consistency.

pull/1469/head
Dean Camera 16 years ago
parent a67bd74e3e
commit 4897ef8972

@ -62,6 +62,7 @@ int main(void)
if (Microphone_Audio_Interface.InterfaceEnabled) if (Microphone_Audio_Interface.InterfaceEnabled)
ProcessNextSample(); ProcessNextSample();
USB_Audio_USBTask(&Microphone_Audio_Interface);
USB_USBTask(); USB_USBTask();
} }
} }

@ -62,6 +62,7 @@ int main(void)
if (Speaker_Audio_Interface.InterfaceEnabled) if (Speaker_Audio_Interface.InterfaceEnabled)
ProcessNextSample(); ProcessNextSample();
USB_Audio_USBTask(&Speaker_Audio_Interface);
USB_USBTask(); USB_USBTask();
} }
} }

@ -64,6 +64,7 @@ int main(void)
{ {
CheckJoystickMovement(); CheckJoystickMovement();
USB_MIDI_USBTask(&Keyboard_MIDI_Interface);
USB_USBTask(); USB_USBTask();
} }
} }
@ -168,3 +169,9 @@ void EVENT_USB_ConfigurationChanged(void)
if (!(USB_MIDI_ConfigureEndpoints(&Keyboard_MIDI_Interface))) if (!(USB_MIDI_ConfigureEndpoints(&Keyboard_MIDI_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
USB_MIDI_ProcessControlPacket(&Keyboard_MIDI_Interface);
}

@ -80,6 +80,11 @@ bool USB_Audio_ConfigureEndpoints(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
return true; return true;
} }
void USB_Audio_USBTask(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
{
}
int8_t USB_Audio_ReadSample8(void) int8_t USB_Audio_ReadSample8(void)
{ {
int8_t Sample; int8_t Sample;

@ -30,6 +30,11 @@
#include "MIDI.h" #include "MIDI.h"
void USB_MIDI_ProcessControlPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
{
}
bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo) bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
{ {
if (MIDIInterfaceInfo->DataINEndpointNumber) if (MIDIInterfaceInfo->DataINEndpointNumber)
@ -55,6 +60,11 @@ bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
return true; return true;
} }
void USB_MIDI_USBTask(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
{
}
void USB_MIDI_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event) void USB_MIDI_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event)
{ {
if (!(USB_IsConnected)) if (!(USB_IsConnected))

@ -155,6 +155,7 @@
/* Function Prototypes: */ /* Function Prototypes: */
bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo); bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
void USB_MIDI_ProcessControlPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
void USB_MIDI_USBTask(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo); void USB_MIDI_USBTask(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
void USB_MIDI_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event); void USB_MIDI_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event);

Loading…
Cancel
Save