/** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user\r
* application started.\r
*/\r
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
{\r
/* Upon disconnection, run user application */\r
RunBootloader = false;\r
* control requests that are not handled internally by the USB library (including the DFU commands, which are\r
* all issued via the control endpoint), so that they can be handled appropriately for the application.\r
*/\r
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
{\r
- /* Discard unused wIndex value */\r
- Endpoint_Discard_Word();\r
- \r
- /* Discard unused wValue value */\r
- Endpoint_Discard_Word();\r
-\r
/* Get the size of the command and data from the wLength value */\r
- SentCommand.DataSize = Endpoint_Read_Word_LE();\r
+ SentCommand.DataSize = USB_ControlRequest.wLength;\r
\r
- switch (bRequest)\r
+ switch (USB_ControlRequest.bRequest)\r
{\r
case DFU_DNLOAD:\r
Endpoint_ClearSETUP();\r