X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/782614dbb55addcae8c9d4d9e1ce3dec81287282..2e6370a6b9a4893d686a8beba603b12be0376ea6:/Bootloaders/HID/BootloaderHID.c?ds=inline diff --git a/Bootloaders/HID/BootloaderHID.c b/Bootloaders/HID/BootloaderHID.c index 174041e45..4a439544f 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 */ - uint16_t PageAddress = Endpoint_Read_Word_LE(); + #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 (FLASHEND > 0xFFFF) + if ((uint16_t)(PageAddress >> 8) == COMMAND_STARTAPPLICATION) + #else if (PageAddress == COMMAND_STARTAPPLICATION) + #endif { RunBootloader = false; } @@ -137,7 +145,7 @@ void EVENT_USB_Device_ControlRequest(void) } /* Write the next data word to the FLASH page */ - boot_page_fill(PageAddress + ((uint16_t)PageWord << 1), Endpoint_Read_Word_LE()); + boot_page_fill(PageAddress + ((uint16_t)PageWord << 1), Endpoint_Read_16_LE()); } /* Write the filled FLASH page to memory */