Renamed all library events to properly seperate out Device and Host mode events. Changed the firing conditions for some events to ensure that events are fired by their own USB mode only.
Remove VBUS events - not needed as the library takes care of VBUS detection and feedback on supported AVRs via the USB_Device_Connected and USB_Device_Disconnected events. Fixed incorrect Host state assignment in the incomplete BluetoothHost demo.
This commit is contained in:
parent
357ccc577b
commit
c5038f1bf4
120 changed files with 666 additions and 759 deletions
|
@ -112,7 +112,7 @@ void ProcessNextSample(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
||||
|
@ -123,7 +123,7 @@ void EVENT_USB_Connect(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Stop the sample reload timer */
|
||||
TCCR0B = 0;
|
||||
|
@ -132,7 +132,7 @@ void EVENT_USB_Disconnect(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -140,8 +140,8 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
Audio_Device_ProcessControlPacket(&Microphone_Audio_Interface);
|
||||
Audio_Device_ProcessControlRequest(&Microphone_Audio_Interface);
|
||||
}
|
||||
|
|
|
@ -76,9 +76,9 @@
|
|||
void SetupHardware(void);
|
||||
void ProcessNextSample(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -140,7 +140,7 @@ void ProcessNextSample(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
||||
|
@ -169,7 +169,7 @@ void EVENT_USB_Connect(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
||||
|
@ -194,7 +194,7 @@ void EVENT_USB_Disconnect(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -202,8 +202,8 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
Audio_Device_ProcessControlPacket(&Speaker_Audio_Interface);
|
||||
Audio_Device_ProcessControlRequest(&Speaker_Audio_Interface);
|
||||
}
|
||||
|
|
|
@ -68,9 +68,9 @@
|
|||
void SetupHardware(void);
|
||||
void ProcessNextSample(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -155,19 +155,19 @@ void CheckJoystickMovement(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -175,8 +175,8 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);
|
||||
CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);
|
||||
}
|
||||
|
|
|
@ -67,9 +67,9 @@
|
|||
void SetupHardware(void);
|
||||
void CheckJoystickMovement(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -163,19 +163,19 @@ void CheckJoystickMovement(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -186,9 +186,9 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
CDC_Device_ProcessControlPacket(&VirtualSerial1_CDC_Interface);
|
||||
CDC_Device_ProcessControlPacket(&VirtualSerial2_CDC_Interface);
|
||||
CDC_Device_ProcessControlRequest(&VirtualSerial1_CDC_Interface);
|
||||
CDC_Device_ProcessControlRequest(&VirtualSerial2_CDC_Interface);
|
||||
}
|
||||
|
|
|
@ -67,9 +67,9 @@
|
|||
void SetupHardware(void);
|
||||
void CheckJoystickMovement(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -103,19 +103,19 @@ void SetupHardware(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -123,10 +123,10 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
HID_Device_ProcessControlPacket(&Generic_HID_Interface);
|
||||
HID_Device_ProcessControlRequest(&Generic_HID_Interface);
|
||||
}
|
||||
|
||||
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
|
||||
|
|
|
@ -67,10 +67,10 @@
|
|||
/* Function Prototypes: */
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
void* ReportData, uint16_t* ReportSize);
|
||||
|
|
|
@ -97,19 +97,19 @@ void SetupHardware(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -117,10 +117,10 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
HID_Device_ProcessControlPacket(&Joystick_HID_Interface);
|
||||
HID_Device_ProcessControlRequest(&Joystick_HID_Interface);
|
||||
}
|
||||
|
||||
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
|
||||
|
|
|
@ -78,10 +78,10 @@
|
|||
/* Function Prototypes: */
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
void* ReportData, uint16_t* ReportSize);
|
||||
|
|
|
@ -98,19 +98,19 @@ void SetupHardware()
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -118,10 +118,10 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
HID_Device_ProcessControlPacket(&Keyboard_HID_Interface);
|
||||
HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);
|
||||
}
|
||||
|
||||
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
|
||||
|
|
|
@ -81,10 +81,10 @@
|
|||
/* Function Prototypes: */
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
void* ReportData, uint16_t* ReportSize);
|
||||
|
|
|
@ -121,19 +121,19 @@ void SetupHardware()
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -144,11 +144,11 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
HID_Device_ProcessControlPacket(&Keyboard_HID_Interface);
|
||||
HID_Device_ProcessControlPacket(&Mouse_HID_Interface);
|
||||
HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);
|
||||
HID_Device_ProcessControlRequest(&Mouse_HID_Interface);
|
||||
}
|
||||
|
||||
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
|
||||
|
|
|
@ -85,10 +85,10 @@
|
|||
/* Function Prototypes: */
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
void* ReportData, uint16_t* ReportSize);
|
||||
|
|
|
@ -157,19 +157,19 @@ void CheckJoystickMovement(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -177,8 +177,8 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
MIDI_Device_ProcessControlPacket(&Keyboard_MIDI_Interface);
|
||||
MIDI_Device_ProcessControlRequest(&Keyboard_MIDI_Interface);
|
||||
}
|
||||
|
|
|
@ -69,9 +69,9 @@
|
|||
void SetupHardware(void);
|
||||
void CheckJoystickMovement(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -92,19 +92,19 @@ void SetupHardware(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -112,10 +112,10 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
MS_Device_ProcessControlPacket(&Disk_MS_Interface);
|
||||
MS_Device_ProcessControlRequest(&Disk_MS_Interface);
|
||||
}
|
||||
|
||||
/** Mass Storage class driver callback function the reception of SCSI commands from the host, which must be processed.
|
||||
|
|
|
@ -78,10 +78,10 @@
|
|||
/* Function Prototypes: */
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* MSInterfaceInfo);
|
||||
|
||||
|
|
|
@ -96,20 +96,20 @@ void SetupHardware(void)
|
|||
TIMSK0 = (1 << OCIE0A);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
/** Event handler for the library USB WakeUp event. */
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
/** Event handler for the library USB Suspend event. */
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -117,10 +117,10 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
HID_Device_ProcessControlPacket(&Mouse_HID_Interface);
|
||||
HID_Device_ProcessControlRequest(&Mouse_HID_Interface);
|
||||
}
|
||||
|
||||
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
|
||||
|
|
|
@ -80,10 +80,10 @@
|
|||
/* Function Prototypes: */
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Device_Connect(void);
|
||||
void EVENT_USB_Device_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_Device_UnhandledControlRequest(void);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
void* ReportData, uint16_t* ReportSize);
|
||||
|
|
|
@ -107,19 +107,19 @@ void SetupHardware(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -127,8 +127,8 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
RNDIS_Device_ProcessControlPacket(&Ethernet_RNDIS_Interface);
|
||||
RNDIS_Device_ProcessControlRequest(&Ethernet_RNDIS_Interface);
|
||||
}
|
||||
|
|
|
@ -76,9 +76,9 @@
|
|||
/* Function Prototypes: */
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -116,19 +116,19 @@ void SetupHardware(void)
|
|||
}
|
||||
|
||||
/** Event handler for the library USB Connection event. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Disconnection event. */
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Configuration Changed event. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -136,10 +136,10 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/** Event handler for the library USB Unhandled Control Packet event. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the library USB Unhandled Control Request event. */
|
||||
void EVENT_USB_Device_UnhandledControlPacket(void)
|
||||
{
|
||||
CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);
|
||||
CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);
|
||||
}
|
||||
|
||||
/** ISR to manage the reception of data from the serial port, placing received bytes into a circular buffer
|
||||
|
|
|
@ -69,10 +69,10 @@
|
|||
/* Function Prototypes: */
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);
|
||||
|
||||
|
|
|
@ -82,17 +82,17 @@ void SetupHardware(void)
|
|||
SerialStream_Init(9600, false);
|
||||
}
|
||||
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
||||
|
@ -112,7 +112,7 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
}
|
||||
}
|
||||
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Process UFI specific control requests */
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
|
|
|
@ -65,9 +65,9 @@
|
|||
void SetupHardware(void);
|
||||
void SideShow_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -78,7 +78,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs, and
|
||||
* configures the sample update and PWM timers.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -92,7 +92,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Stop the sample reload timer */
|
||||
TCCR0B = 0;
|
||||
|
@ -107,7 +107,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
|
||||
* of the USB device after enumeration - the device endpoints are configured.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -121,11 +121,11 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
}
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
||||
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
|
||||
* control requests that are not handled internally by the USB library (including the Audio class-specific
|
||||
* requests) so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Process General and Audio specific control requests */
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
|
|
|
@ -74,9 +74,9 @@
|
|||
void SetupHardware(void);
|
||||
void USB_Audio_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -73,7 +73,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs, and
|
||||
* configures the sample update and PWM timers.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -105,7 +105,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Stop the timers */
|
||||
TCCR0B = 0;
|
||||
|
@ -134,7 +134,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
|
||||
* of the USB device after enumeration - the device endpoints are configured.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -148,11 +148,11 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
}
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
||||
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
|
||||
* control requests that are not handled internally by the USB library (including the Audio class-specific
|
||||
* requests) so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Process General and Audio specific control requests */
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
|
|
|
@ -65,9 +65,9 @@
|
|||
void SetupHardware(void);
|
||||
void USB_Audio_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -143,7 +143,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -152,7 +152,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs and stops the USB management and CDC management tasks.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Indicate USB not ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -161,7 +161,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
|
||||
* of the USB device after enumeration - the device endpoints are configured and the CDC management task started.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -187,13 +187,16 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/* Reset line encoding baud rate so that the host knows to send new values */
|
||||
LineEncoding.BaudRateBPS = 0;
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
||||
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
|
||||
* control requests that are not handled internally by the USB library (including the CDC control commands,
|
||||
* which are all issued via the control endpoint), so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Process CDC specific control requests */
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
|
|
|
@ -175,9 +175,9 @@
|
|||
void SetupHardware(void);
|
||||
void CDC_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -97,7 +97,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -106,7 +106,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs and stops the USB management and CDC management tasks.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Indicate USB not ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -115,7 +115,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
|
||||
* of the USB device after enumeration - the device endpoints are configured and the CDC management tasks are started.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -163,13 +163,17 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/* Reset line encoding baud rates so that the host knows to send new values */
|
||||
LineEncoding1.BaudRateBPS = 0;
|
||||
LineEncoding2.BaudRateBPS = 0;
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
||||
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
|
||||
* control requests that are not handled internally by the USB library (including the CDC control commands,
|
||||
* which are all issued via the control endpoint), so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Determine which interface's Line Coding data is being set from the wIndex parameter */
|
||||
uint8_t* LineEncodingData = (USB_ControlRequest.wIndex == 0) ? (uint8_t*)&LineEncoding1 : (uint8_t*)&LineEncoding2;
|
||||
|
|
|
@ -111,9 +111,9 @@
|
|||
void CDC2_Task(void);
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -74,7 +74,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -83,7 +83,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs and stops the USB management task.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Indicate USB not ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -92,7 +92,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
|
||||
* of the USB device after enumeration, and configures the generic HID device endpoints.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -114,11 +114,11 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
}
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
||||
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
|
||||
* control requests that are not handled internally by the USB library (including the HID commands, which are
|
||||
* all issued via the control endpoint), so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Handle HID Class specific requests */
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
|
|
|
@ -73,10 +73,10 @@
|
|||
void SetupHardware(void);
|
||||
void HID_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
void ProcessGenericHIDReport(uint8_t* DataArray);
|
||||
void CreateGenericHIDReport(uint8_t* DataArray);
|
||||
|
|
|
@ -72,7 +72,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -81,7 +81,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs and stops the USB management and joystick reporting tasks.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Indicate USB not ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -90,7 +90,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
|
||||
* of the USB device after enumeration - the device endpoints are configured and the joystick reporting task started.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -104,11 +104,11 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
}
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
||||
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
|
||||
* control requests that are not handled internally by the USB library (including the HID commands, which are
|
||||
* all issued via the control endpoint), so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Handle HID Class specific requests */
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
|
|
|
@ -81,10 +81,10 @@
|
|||
void SetupHardware(void);
|
||||
void HID_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
bool GetNextReport(USB_JoystickReport_Data_t* ReportData);
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -108,7 +108,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Indicate USB not ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -117,7 +117,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
|
||||
* of the USB device after enumeration, and configures the keyboard device endpoints.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -139,11 +139,11 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
}
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
||||
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
|
||||
* control requests that are not handled internally by the USB library (including the HID commands, which are
|
||||
* all issued via the control endpoint), so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Handle HID Class specific requests */
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
|
|
|
@ -101,10 +101,10 @@
|
|||
void SetupHardware(void);
|
||||
void HID_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
void CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData);
|
||||
void ProcessLEDReport(uint8_t LEDReport);
|
||||
|
|
|
@ -80,7 +80,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -89,7 +89,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs and stops the USB management task.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Indicate USB not ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -98,7 +98,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
|
||||
* of the USB device after enumeration, and configures the keyboard and mouse device endpoints.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -132,7 +132,7 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
* control requests that are not handled internally by the USB library (including the HID commands, which are
|
||||
* all issued via the control endpoint), so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
uint8_t* ReportData;
|
||||
uint8_t ReportSize;
|
||||
|
|
|
@ -98,9 +98,9 @@
|
|||
void Keyboard_HID_Task(void);
|
||||
void Mouse_HID_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -70,7 +70,7 @@ void SetupHardware(void)
|
|||
}
|
||||
|
||||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -79,7 +79,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs, disables the sample update and PWM output timers and stops the USB and MIDI management tasks.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Indicate USB not ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -88,7 +88,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
|
||||
* of the USB device after enumeration - the device endpoints are configured and the MIDI management task started.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
|
|
@ -95,8 +95,8 @@
|
|||
void SetupHardware(void);
|
||||
void MIDI_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -83,7 +83,7 @@ void SetupHardware(void)
|
|||
}
|
||||
|
||||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -95,7 +95,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs and stops the Mass Storage management task.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Indicate USB not ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -104,7 +104,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
|
||||
* of the USB device after enumeration - the device endpoints are configured and the Mass Storage management task started.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -129,7 +129,7 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
* control requests that are not handled internally by the USB library (including the Mass Storage class-specific
|
||||
* requests) so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Process UFI specific control requests */
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
|
|
|
@ -136,10 +136,10 @@
|
|||
void SetupHardware(void);
|
||||
void MassStorage_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#if defined(INCLUDE_FROM_MASSSTORAGE_C)
|
||||
static bool ReadInCommandBlock(void);
|
||||
|
|
|
@ -96,7 +96,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -108,7 +108,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs and stops the USB management and Mouse reporting tasks.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Indicate USB not ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -117,7 +117,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
|
||||
* of the USB device after enumeration - the device endpoints are configured and the mouse reporting task started.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -131,11 +131,11 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
}
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
||||
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
|
||||
* control requests that are not handled internally by the USB library (including the HID commands, which are
|
||||
* all issued via the control endpoint), so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Handle HID Class specific requests */
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
|
|
|
@ -101,10 +101,10 @@
|
|||
void SetupHardware(void);
|
||||
void Mouse_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
void CreateMouseReport(USB_MouseReport_Data_t* ReportData);
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -88,7 +88,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs and stops all the relevant tasks.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Indicate USB not ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -97,7 +97,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
|
||||
* of the USB device after enumeration, and configures the RNDIS device endpoints and starts the relevant tasks.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -125,11 +125,11 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
}
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
||||
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
|
||||
* control requests that are not handled internally by the USB library (including the RNDIS control commands,
|
||||
* which set up the USB RNDIS network adapter), so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Process RNDIS class commands */
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
|
|
|
@ -94,9 +94,9 @@
|
|||
void RNDIS_Task(void);
|
||||
void Ethernet_Task(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -89,7 +89,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
/* Indicate USB enumerating */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -98,7 +98,7 @@ void EVENT_USB_Connect(void)
|
|||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs and stops the USB management and CDC management tasks.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
/* Reset Tx and Rx buffers, device disconnected */
|
||||
Buffer_Initialize(&Rx_Buffer);
|
||||
|
@ -111,7 +111,7 @@ void EVENT_USB_Disconnect(void)
|
|||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
|
||||
* of the USB device after enumeration - the device endpoints are configured and the CDC management task started.
|
||||
*/
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
/* Indicate USB connected and ready */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
|
@ -137,13 +137,16 @@ void EVENT_USB_ConfigurationChanged(void)
|
|||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
}
|
||||
|
||||
/* Reset line encoding baud rate so that the host knows to send new values */
|
||||
LineEncoding.BaudRateBPS = 0;
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
||||
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
|
||||
* control requests that are not handled internally by the USB library (including the CDC control commands,
|
||||
* which are all issued via the control endpoint), so that they can be handled appropriately for the application.
|
||||
*/
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
/* Process CDC specific control requests */
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
|
|
|
@ -178,9 +178,9 @@
|
|||
void CDC_Task(void);
|
||||
void ReconfigureUSART(void);
|
||||
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -130,7 +130,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR("Device Attached.\r\n"));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -139,7 +139,7 @@ void EVENT_USB_DeviceAttached(void)
|
|||
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
|
||||
* stops the library USB task management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR("\r\nDevice Unattached.\r\n"));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -148,13 +148,13 @@ void EVENT_USB_DeviceUnattached(void)
|
|||
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
|
||||
* enumerated by the host and is now ready to be used by the application.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode)
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
|
||||
{
|
||||
USB_ShutDown();
|
||||
|
||||
|
@ -168,7 +168,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
|
|||
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while
|
||||
* enumerating an attached USB device.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
|
|
@ -66,10 +66,10 @@
|
|||
/* Function Prototypes: */
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -132,7 +132,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR("Device Attached.\r\n"));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -141,7 +141,7 @@ void EVENT_USB_DeviceAttached(void)
|
|||
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
|
||||
* stops the library USB task management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR("\r\nDevice Unattached.\r\n"));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -150,13 +150,13 @@ void EVENT_USB_DeviceUnattached(void)
|
|||
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
|
||||
* enumerated by the host and is now ready to be used by the application.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode)
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
|
||||
{
|
||||
USB_ShutDown();
|
||||
|
||||
|
@ -170,7 +170,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
|
|||
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while
|
||||
* enumerating an attached USB device.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
|
|
@ -66,10 +66,10 @@
|
|||
/* Function Prototypes: */
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -75,26 +75,26 @@ void SetupHardware(void)
|
|||
USB_Init();
|
||||
}
|
||||
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));
|
||||
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
}
|
||||
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));
|
||||
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
}
|
||||
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
||||
void EVENT_USB_HostError(uint8_t ErrorCode)
|
||||
void EVENT_USB_Host_HostError(uint8_t ErrorCode)
|
||||
{
|
||||
USB_ShutDown();
|
||||
|
||||
|
@ -105,7 +105,7 @@ void EVENT_USB_HostError(uint8_t ErrorCode)
|
|||
for(;;);
|
||||
}
|
||||
|
||||
void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
@ -158,9 +158,6 @@ void Bluetooth_Management_Task(void)
|
|||
break;
|
||||
}
|
||||
|
||||
USB_HostState = HOST_STATE_Configured;
|
||||
break;
|
||||
case HOST_STATE_Configured:
|
||||
puts_P(PSTR("Getting Config Data.\r\n"));
|
||||
|
||||
/* Get and process the configuration descriptor data */
|
||||
|
@ -183,7 +180,7 @@ void Bluetooth_Management_Task(void)
|
|||
|
||||
puts_P(PSTR("Bluetooth Dongle Enumerated.\r\n"));
|
||||
|
||||
USB_HostState = HOST_STATE_Ready;
|
||||
USB_HostState = HOST_STATE_Configured;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,11 +70,11 @@
|
|||
void Bluetooth_Management_Task(void);
|
||||
|
||||
/* Event Handlers: */
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_HostError(uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);
|
||||
|
||||
/* Function Prototypes: */
|
||||
void SetupHardware(void);
|
||||
|
|
|
@ -398,7 +398,7 @@ void Bluetooth_ProcessHCICommands(void)
|
|||
{
|
||||
while (!(Bluetooth_GetNextHCIEventHeader()))
|
||||
{
|
||||
if (USB_DeviceState == DEVICE_STATE_Unattached)
|
||||
if (USB_HostState == HOST_STATE_Unattached)
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
|
|||
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
|
||||
* stops the library USB task management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
|
|||
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
|
||||
* enumerated by the host and is now ready to be used by the application.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode)
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
|
||||
{
|
||||
USB_ShutDown();
|
||||
|
||||
|
@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
|
|||
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while
|
||||
* enumerating an attached USB device.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
|
|
@ -117,10 +117,10 @@
|
|||
void SetupHardware(void);
|
||||
void CDC_Host_Task(void);
|
||||
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -73,7 +73,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
|
|||
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
|
||||
* stops the library USB task management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
|
|||
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
|
||||
* enumerated by the host and is now ready to be used by the application.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode)
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
|
||||
{
|
||||
USB_ShutDown();
|
||||
|
||||
|
@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
|
|||
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while
|
||||
* enumerating an attached USB device.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
|
|
@ -84,11 +84,11 @@
|
|||
void SetupHardware(void);
|
||||
void HID_Host_Task(void);
|
||||
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
|
||||
void ReadNextReport(void);
|
||||
void WriteNextReport(uint8_t* ReportOUTData, uint8_t ReportIndex, uint8_t ReportType, uint16_t ReportLength);
|
||||
|
|
|
@ -73,7 +73,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
|
|||
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
|
||||
* stops the library USB task management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
|
|||
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
|
||||
* enumerated by the host and is now ready to be used by the application.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode)
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
|
||||
{
|
||||
USB_ShutDown();
|
||||
|
||||
|
@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
|
|||
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while
|
||||
* enumerating an attached USB device.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
|
|
@ -84,11 +84,11 @@
|
|||
void Keyboard_HID_Task(void);
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
|
||||
void ReadNextReport(void);
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
|
|||
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
|
||||
* stops the library USB task management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
|
|||
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
|
||||
* enumerated by the host and is now ready to be used by the application.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode)
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
|
||||
{
|
||||
USB_ShutDown();
|
||||
|
||||
|
@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
|
|||
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while
|
||||
* enumerating an attached USB device.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
|
|
@ -67,11 +67,11 @@
|
|||
void Keyboard_HID_Task(void);
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
|
||||
void ProcessKeyboardReport(uint8_t* KeyboardReport);
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -88,7 +88,7 @@ void EVENT_USB_DeviceAttached(void)
|
|||
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
|
||||
* stops the library USB task management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -97,7 +97,7 @@ void EVENT_USB_DeviceUnattached(void)
|
|||
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
|
||||
* enumerated by the host and is now ready to be used by the application.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
|
|||
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while
|
||||
* enumerating an attached USB device.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
|
|
@ -76,11 +76,11 @@
|
|||
void MassStorage_Task(void);
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
|
||||
void ShowDiskReadError(char* CommandString, bool FailedAtSCSILayer, uint8_t ErrorCode);
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
|
|||
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
|
||||
* stops the library USB task management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
|
|||
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
|
||||
* enumerated by the host and is now ready to be used by the application.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode)
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
|
||||
{
|
||||
USB_ShutDown();
|
||||
|
||||
|
@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
|
|||
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while
|
||||
* enumerating an attached USB device.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
|
|
@ -84,11 +84,11 @@
|
|||
void Mouse_HID_Task(void);
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
|
||||
void ReadNextReport(void);
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
|
|||
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
|
||||
* stops the library USB task management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
|
|||
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
|
||||
* enumerated by the host and is now ready to be used by the application.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode)
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
|
||||
{
|
||||
USB_ShutDown();
|
||||
|
||||
|
@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
|
|||
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while
|
||||
* enumerating an attached USB device.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
|
|
@ -67,11 +67,11 @@
|
|||
void Mouse_HID_Task(void);
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
|
||||
void ProcessMouseReport(uint8_t* MouseReport);
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
|
|||
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
|
||||
* stops the library USB task management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
|
|||
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
|
||||
* enumerated by the host and is now ready to be used by the application.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
|
||||
void EVENT_USB_HostError(uint8_t ErrorCode)
|
||||
void EVENT_USB_Host_HostError(uint8_t ErrorCode)
|
||||
{
|
||||
USB_ShutDown();
|
||||
|
||||
|
@ -111,7 +111,7 @@ void EVENT_USB_HostError(uint8_t ErrorCode)
|
|||
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while
|
||||
* enumerating an attached USB device.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
|
|
@ -70,11 +70,11 @@
|
|||
#define LEDMASK_USB_BUSY (LEDS_LED2)
|
||||
|
||||
/* Function Prototypes: */
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_HostError(uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);
|
||||
|
||||
void SetupHardware(void);
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ void SetupHardware(void)
|
|||
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
|
||||
* starts the library USB task to begin the enumeration and USB management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
|
||||
|
@ -83,7 +83,7 @@ void EVENT_USB_DeviceAttached(void)
|
|||
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
|
||||
* stops the library USB task management process.
|
||||
*/
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
|
@ -92,13 +92,13 @@ void EVENT_USB_DeviceUnattached(void)
|
|||
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
|
||||
* enumerated by the host and is now ready to be used by the application.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode)
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
|
||||
{
|
||||
USB_ShutDown();
|
||||
|
||||
|
@ -112,7 +112,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
|
|||
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while
|
||||
* enumerating an attached USB device.
|
||||
*/
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
|
|
|
@ -72,11 +72,11 @@
|
|||
void StillImage_Task(void);
|
||||
void SetupHardware(void);
|
||||
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
|
||||
void UnicodeToASCII(uint8_t* restrict UnicodeString, char* restrict Buffer);
|
||||
void ShowCommandError(uint8_t ErrorCode, bool ResponseCodeError);
|
||||
|
|
|
@ -54,71 +54,17 @@ static void Abort_Program(void)
|
|||
for (;;);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_VBUSChange event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_VBUSChange(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "VBUS Change\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_VBUSConnect event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_VBUSConnect(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "VBUS +\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_VBUSDisconnect event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_VBUSDisconnect(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "VBUS -\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler for the USB_Connect event. When fired, the event is logged to the USART and the
|
||||
* USB task started.
|
||||
*/
|
||||
void EVENT_USB_Connect(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB +\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler for the USB_Disconnect event. When fired, the event is logged to the USART and the
|
||||
* USB task stopped.
|
||||
*/
|
||||
void EVENT_USB_Disconnect(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB -\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_Suspend event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Suspend(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Sleep\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_WakeUp event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_WakeUp(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Wakeup\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_Reset event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Reset(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Reset\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UIDChange event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_UIDChange(void)
|
||||
{
|
||||
char* ModeStrPtr;
|
||||
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "UID Change\r\n"));
|
||||
puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "UID Change\r\n"));
|
||||
|
||||
if (USB_CurrentMode == USB_MODE_DEVICE)
|
||||
ModeStrPtr = PSTR("HOST");
|
||||
else if (USB_CurrentMode == USB_MODE_HOST)
|
||||
ModeStrPtr = PSTR("DEVICE");
|
||||
else if (USB_CurrentMode == USB_MODE_HOST)
|
||||
ModeStrPtr = PSTR("HOST");
|
||||
else
|
||||
ModeStrPtr = PSTR("N/A");
|
||||
|
||||
|
@ -126,7 +72,7 @@ void EVENT_USB_UIDChange(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* Event handler for the USB_PowerOnFail event. When fired, the event is logged to the USART and the program
|
||||
* Event handler for the USB_InitFailure event. When fired, the event is logged to the USART and the program
|
||||
* execution aborted.
|
||||
*/
|
||||
void EVENT_USB_InitFailure(const uint8_t ErrorCode)
|
||||
|
@ -148,29 +94,38 @@ void EVENT_USB_InitFailure(const uint8_t ErrorCode)
|
|||
Abort_Program();
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler for the USB_HostError event. When fired, the event is logged to the USART and the program
|
||||
* execution aborted.
|
||||
*/
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode)
|
||||
/** Event handler for the USB_Device_Connect event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Device_Connect(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Host Mode Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);
|
||||
|
||||
Abort_Program();
|
||||
puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "USB Connect\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_DeviceEnumerationFailed event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
/** Event handler for the USB_Device_Disconnect event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Device_Disconnect(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);
|
||||
printf_P(PSTR(" -- In State %d\r\n" ESC_FG_WHITE), USB_HostState);
|
||||
puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "USB Disconnect\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_UnhandledControlPacket event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_UnhandledControlPacket(void)
|
||||
/** Event handler for the USB_Device_Suspend event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Device_Suspend(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Sleep\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_Device_WakeUp event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Device_WakeUp(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Wakeup\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_Device_Reset event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Device_Reset(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Reset\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_Device_UnhandledControlRequest event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "Ctrl Request\r\n"));
|
||||
printf_P(PSTR(" -- Req Data %d\r\n"), USB_ControlRequest.bRequest);
|
||||
|
@ -178,26 +133,47 @@ void EVENT_USB_UnhandledControlPacket(void)
|
|||
printf_P(PSTR(" -- Req Length %d\r\n" ESC_FG_WHITE), USB_ControlRequest.wLength);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_ConfigurationChanged event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_ConfigurationChanged(void)
|
||||
/** Event handler for the USB_Device_ConfigurationChanged event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "Configuration Number Changed\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_DeviceAttached event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_DeviceAttached(void)
|
||||
/**
|
||||
* Event handler for the USB_Host_HostError event. When fired, the event is logged to the USART and the program
|
||||
* execution aborted.
|
||||
*/
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device +\r\n" ESC_FG_WHITE));
|
||||
puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Host Mode Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);
|
||||
|
||||
Abort_Program();
|
||||
}
|
||||
|
||||
/** Event handler for the USB_DeviceUnattached event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_DeviceUnattached(void)
|
||||
/** Event handler for the USB_Host_DeviceEnumerationFailed event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device -\r\n" ESC_FG_WHITE));
|
||||
puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Dev Enum Error\r\n"));
|
||||
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
|
||||
printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);
|
||||
printf_P(PSTR(" -- In State %d\r\n" ESC_FG_WHITE), USB_HostState);
|
||||
}
|
||||
|
||||
/** Event handler for the USB_DeviceEnumerationComplete event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_DeviceEnumerationComplete(void)
|
||||
/** Event handler for the USB_Host_DeviceEnumerationComplete event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "Device Enumeration Complete\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_Host_DeviceAttached event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Host_DeviceAttached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device Attached\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
||||
/** Event handler for the USB_Host_DeviceUnattached event. When fired, the event is logged to the USART. */
|
||||
void EVENT_USB_Host_DeviceUnattached(void)
|
||||
{
|
||||
puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device Unattached\r\n" ESC_FG_WHITE));
|
||||
}
|
||||
|
|
|
@ -54,22 +54,19 @@
|
|||
static void Abort_Program(void) ATTR_NO_RETURN;
|
||||
#endif
|
||||
|
||||
void EVENT_USB_VBUSChange(void);
|
||||
void EVENT_USB_VBUSConnect(void);
|
||||
void EVENT_USB_VBUSDisconnect(void);
|
||||
void EVENT_USB_Connect(void);
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_InitFailure(const uint8_t ErrorCode);
|
||||
void EVENT_USB_UIDChange(void);
|
||||
void EVENT_USB_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_DeviceAttached(void);
|
||||
void EVENT_USB_DeviceUnattached(void);
|
||||
void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_Suspend(void);
|
||||
void EVENT_USB_WakeUp(void);
|
||||
void EVENT_USB_Reset(void);
|
||||
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
|
||||
void EVENT_USB_Host_DeviceAttached(void);
|
||||
void EVENT_USB_Host_DeviceUnattached(void);
|
||||
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
|
||||
void EVENT_USB_Host_DeviceEnumerationComplete(void);
|
||||
void EVENT_USB_Device_Connect(void);
|
||||
void EVENT_USB_Device_Disconnect(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_Suspend(void);
|
||||
void EVENT_USB_Device_WakeUp(void);
|
||||
void EVENT_USB_Device_Reset(void);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue