X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/d860e9e842c05e759214f5170f78783decae9956..ccf5bd19f2d750440043b242cf26fcda09b69cce:/Bootloaders/DFU/BootloaderDFU.c diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c index 83881f13e..6da741e39 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,7 +149,7 @@ 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) { /* Get the size of the command and data from the wLength value */ SentCommand.DataSize = USB_ControlRequest.wLength; @@ -342,7 +342,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket) } /* Read the flash word and send it via USB to the host */ - #if defined(RAMPZ) + #if (FLASHEND > 0xFFFF) Endpoint_Write_Word_LE(pgm_read_word_far(CurrFlashAddress.Long)); #else Endpoint_Write_Word_LE(pgm_read_word(CurrFlashAddress.Long)); @@ -462,8 +462,10 @@ static void DiscardFillerBytes(uint8_t NumberOfBytes) /* Wait until next data packet received */ while (!(Endpoint_IsOUTReceived())); } - - Endpoint_Discard_Byte(); + else + { + Endpoint_Discard_Byte(); + } } } @@ -585,7 +587,7 @@ static void ProcessMemReadCommand(void) while (CurrFlashAddress < BOOT_START_ADDR) { /* Check if the current byte is not blank */ - #if defined(RAMPZ) + #if (FLASHEND > 0xFFFF) if (pgm_read_byte_far(CurrFlashAddress) != 0xFF) #else if (pgm_read_byte(CurrFlashAddress) != 0xFF)