Commit fb76acb0 authored by Dean Camera's avatar Dean Camera
Browse files

Renamed the EVENT_USB_Device_UnhandledControlRequest() event to...

Renamed the EVENT_USB_Device_UnhandledControlRequest() event to EVENT_USB_Device_ControlRequest() as it is now fired before the library request handlers, not afterwards.
parent 99a9e415
...@@ -121,11 +121,11 @@ void EVENT_USB_Device_ConfigurationChanged(void) ...@@ -121,11 +121,11 @@ void EVENT_USB_Device_ConfigurationChanged(void)
ENDPOINT_BANK_SINGLE); ENDPOINT_BANK_SINGLE);
} }
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific /** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to
* control requests that are not handled internally by the USB library (including the CDC control commands, * the device from the USB host before passing along unhandled control requests to the library for processing
* which are all issued via the control endpoint), so that they can be handled appropriately for the application. * internally.
*/ */
void EVENT_USB_Device_UnhandledControlRequest(void) void EVENT_USB_Device_ControlRequest(void)
{ {
/* Process CDC specific control requests */ /* Process CDC specific control requests */
switch (USB_ControlRequest.bRequest) switch (USB_ControlRequest.bRequest)
......
...@@ -145,11 +145,11 @@ void ResetHardware(void) ...@@ -145,11 +145,11 @@ void ResetHardware(void)
MCUCR = 0; MCUCR = 0;
} }
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific /** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to
* control requests that are not handled internally by the USB library (including the DFU commands, which are * the device from the USB host before passing along unhandled control requests to the library for processing
* all issued via the control endpoint), so that they can be handled appropriately for the application. * internally.
*/ */
void EVENT_USB_Device_UnhandledControlRequest(void) void EVENT_USB_Device_ControlRequest(void)
{ {
/* Get the size of the command and data from the wLength value */ /* Get the size of the command and data from the wLength value */
SentCommand.DataSize = USB_ControlRequest.wLength; SentCommand.DataSize = USB_ControlRequest.wLength;
......
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
void SetupHardware(void); void SetupHardware(void);
void ResetHardware(void); void ResetHardware(void);
void EVENT_USB_Device_UnhandledControlRequest(void); void EVENT_USB_Device_ControlRequest(void);
#if defined(INCLUDE_FROM_BOOTLOADER_C) #if defined(INCLUDE_FROM_BOOTLOADER_C)
static void DiscardFillerBytes(uint8_t NumberOfBytes); static void DiscardFillerBytes(uint8_t NumberOfBytes);
......
...@@ -156,8 +156,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) ...@@ -156,8 +156,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Request event. */ /** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_UnhandledControlRequest(void) void EVENT_USB_Device_ControlRequest(void)
{ {
Audio_Device_ProcessControlRequest(&Microphone_Audio_Interface); Audio_Device_ProcessControlRequest(&Microphone_Audio_Interface);
} }
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void); void EVENT_USB_Device_ControlRequest(void);
#endif #endif
...@@ -192,8 +192,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) ...@@ -192,8 +192,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Request event. */ /** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_UnhandledControlRequest(void) void EVENT_USB_Device_ControlRequest(void)
{ {
Audio_Device_ProcessControlRequest(&Speaker_Audio_Interface); Audio_Device_ProcessControlRequest(&Speaker_Audio_Interface);
} }
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void); void EVENT_USB_Device_ControlRequest(void);
#endif #endif
...@@ -183,8 +183,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) ...@@ -183,8 +183,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Request event. */ /** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_UnhandledControlRequest(void) void EVENT_USB_Device_ControlRequest(void)
{ {
CDC_Device_ProcessControlRequest(&VirtualSerial1_CDC_Interface); CDC_Device_ProcessControlRequest(&VirtualSerial1_CDC_Interface);
CDC_Device_ProcessControlRequest(&VirtualSerial2_CDC_Interface); CDC_Device_ProcessControlRequest(&VirtualSerial2_CDC_Interface);
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void); void EVENT_USB_Device_ControlRequest(void);
#endif #endif
...@@ -122,8 +122,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) ...@@ -122,8 +122,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Request event. */ /** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_UnhandledControlRequest(void) void EVENT_USB_Device_ControlRequest(void)
{ {
HID_Device_ProcessControlRequest(&Generic_HID_Interface); HID_Device_ProcessControlRequest(&Generic_HID_Interface);
} }
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void); void EVENT_USB_Device_ControlRequest(void);
void EVENT_USB_Device_StartOfFrame(void); void EVENT_USB_Device_StartOfFrame(void);
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
......
...@@ -116,8 +116,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) ...@@ -116,8 +116,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Request event. */ /** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_UnhandledControlRequest(void) void EVENT_USB_Device_ControlRequest(void)
{ {
HID_Device_ProcessControlRequest(&Joystick_HID_Interface); HID_Device_ProcessControlRequest(&Joystick_HID_Interface);
} }
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void); void EVENT_USB_Device_ControlRequest(void);
void EVENT_USB_Device_StartOfFrame(void); void EVENT_USB_Device_StartOfFrame(void);
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
......
...@@ -116,8 +116,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) ...@@ -116,8 +116,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Request event. */ /** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_UnhandledControlRequest(void) void EVENT_USB_Device_ControlRequest(void)
{ {
HID_Device_ProcessControlRequest(&Keyboard_HID_Interface); HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);
} }
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void); void EVENT_USB_Device_ControlRequest(void);
void EVENT_USB_Device_StartOfFrame(void); void EVENT_USB_Device_StartOfFrame(void);
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
......
...@@ -140,8 +140,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) ...@@ -140,8 +140,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Request event. */ /** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_UnhandledControlRequest(void) void EVENT_USB_Device_ControlRequest(void)
{ {
HID_Device_ProcessControlRequest(&Keyboard_HID_Interface); HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);
HID_Device_ProcessControlRequest(&Mouse_HID_Interface); HID_Device_ProcessControlRequest(&Mouse_HID_Interface);
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void); void EVENT_USB_Device_ControlRequest(void);
void EVENT_USB_Device_StartOfFrame(void); void EVENT_USB_Device_StartOfFrame(void);
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
......
...@@ -187,8 +187,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) ...@@ -187,8 +187,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Request event. */ /** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_UnhandledControlRequest(void) void EVENT_USB_Device_ControlRequest(void)
{ {
MIDI_Device_ProcessControlRequest(&Keyboard_MIDI_Interface); MIDI_Device_ProcessControlRequest(&Keyboard_MIDI_Interface);
} }
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void); void EVENT_USB_Device_ControlRequest(void);
#endif #endif
...@@ -117,8 +117,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) ...@@ -117,8 +117,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Request event. */ /** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_UnhandledControlRequest(void) void EVENT_USB_Device_ControlRequest(void)
{ {
MS_Device_ProcessControlRequest(&Disk_MS_Interface); MS_Device_ProcessControlRequest(&Disk_MS_Interface);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment