From: Dean Camera Date: Sat, 23 Apr 2011 04:39:21 +0000 (+0000) Subject: Fix HID class bootloader not working on the larger USB AVRs due to the altered page... X-Git-Tag: LUFA-111009-BETA~127 X-Git-Url: http://git.linex4red.de/pub/USBasp.git/commitdiff_plain/8c3d63b5cff33ad73a890e6e294da135200c53a0?ds=sidebyside Fix HID class bootloader not working on the larger USB AVRs due to the altered page addressing scheme. --- diff --git a/Bootloaders/HID/BootloaderHID.c b/Bootloaders/HID/BootloaderHID.c index f04804306..484942f97 100644 --- a/Bootloaders/HID/BootloaderHID.c +++ b/Bootloaders/HID/BootloaderHID.c @@ -113,10 +113,18 @@ void EVENT_USB_Device_ControlRequest(void) while (!(Endpoint_IsOUTReceived())); /* Read in the write destination address */ + #if (FLASHEND > 0xFFFF) + uint32_t PageAddress = ((uint32_t)Endpoint_Read_16_LE() << 8); + #else uint16_t PageAddress = Endpoint_Read_16_LE(); + #endif /* Check if the command is a program page command, or a start application command */ - if (PageAddress == COMMAND_STARTAPPLICATION) + #if (FLASHEND > 0xFFFF) + if ((uint16_t)(PageAddress >> 8) == COMMAND_STARTAPPLICATION) + #else + if (PageAddress == COMMAND_STARTAPPLICATION) + #endif { RunBootloader = false; }