X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/e5e7eaee7af719cee00a8c2cb6fb4649dde0aa05..b9b03aadb219d06fbad9d110e508db93e45461af:/Bootloaders/DFU/BootloaderDFU.c diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c index 289b4eb22..11177c5a6 100644 --- a/Bootloaders/DFU/BootloaderDFU.c +++ b/Bootloaders/DFU/BootloaderDFU.c @@ -139,7 +139,7 @@ int main (void) /** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user * application started. */ -EVENT_HANDLER(USB_Disconnect) +void EVENT_USB_Disconnect(void) { /* Upon disconnection, run user application */ RunBootloader = false; @@ -149,18 +149,12 @@ EVENT_HANDLER(USB_Disconnect) * control requests that are not handled internally by the USB library (including the DFU commands, which are * all issued via the control endpoint), so that they can be handled appropriately for the application. */ -EVENT_HANDLER(USB_UnhandledControlPacket) +void EVENT_USB_UnhandledControlPacket(void) { - /* Discard unused wIndex value */ - Endpoint_Discard_Word(); - - /* Discard unused wValue value */ - Endpoint_Discard_Word(); - /* Get the size of the command and data from the wLength value */ - SentCommand.DataSize = Endpoint_Read_Word_LE(); + SentCommand.DataSize = USB_ControlRequest.wLength; - switch (bRequest) + switch (USB_ControlRequest.bRequest) { case DFU_DNLOAD: Endpoint_ClearSETUP();