*/\r
uint16_t EndAddr = 0x0000;\r
\r
+\r
/** Main program entry point. This routine configures the hardware required by the bootloader, then continuously \r
* runs the bootloader processing routine until instructed to soft-exit, or hard-reset via the watchdog to start\r
* the loaded application code.\r
MCUCR = 0;\r
}\r
\r
-/** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user\r
- * application started.\r
- */\r
-void EVENT_USB_Disconnect(void)\r
-{\r
- /* Upon disconnection, run user application */\r
- RunBootloader = false;\r
-}\r
-\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\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
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Get the size of the command and data from the wLength value */\r
SentCommand.DataSize = USB_ControlRequest.wLength;\r
uint8_t DataIndexToRead = SentCommand.Data[1];\r
\r
if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x00)) // Read bootloader info\r
- {\r
- ResponseByte = BootloaderInfo[DataIndexToRead];\r
- }\r
+ ResponseByte = BootloaderInfo[DataIndexToRead];\r
else if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x01)) // Read signature byte\r
- {\r
- ResponseByte = SignatureInfo[DataIndexToRead - 0x30];\r
- }\r
+ ResponseByte = SignatureInfo[DataIndexToRead - 0x30];\r
}\r