X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/57b382558d0f2a5146bea735943f09c6d1b83286..782614dbb55addcae8c9d4d9e1ce3dec81287282:/Bootloaders/HID/BootloaderHID.c?ds=sidebyside diff --git a/Bootloaders/HID/BootloaderHID.c b/Bootloaders/HID/BootloaderHID.c index 9c6b3e051..174041e45 100644 --- a/Bootloaders/HID/BootloaderHID.c +++ b/Bootloaders/HID/BootloaderHID.c @@ -39,7 +39,7 @@ * via a soft reset. When cleared, the bootloader will abort, the USB interface will shut down and the application * started via a forced watchdog reset. */ -bool RunBootloader = true; +static bool RunBootloader = true; /** Main program entry point. This routine configures the hardware required by the bootloader, then continuously * runs the bootloader processing routine until instructed to soft-exit. @@ -127,7 +127,7 @@ void EVENT_USB_Device_ControlRequest(void) boot_spm_busy_wait(); /* Write each of the FLASH page's bytes in sequence */ - for (uint16_t PageByte = 0; PageByte < SPM_PAGESIZE; PageByte += 2) + for (uint8_t PageWord = 0; PageWord < (SPM_PAGESIZE / 2); PageWord++) { /* Check if endpoint is empty - if so clear it and wait until ready for next packet */ if (!(Endpoint_BytesInEndpoint())) @@ -137,7 +137,7 @@ void EVENT_USB_Device_ControlRequest(void) } /* Write the next data word to the FLASH page */ - boot_page_fill(PageAddress + PageByte, Endpoint_Read_Word_LE()); + boot_page_fill(PageAddress + ((uint16_t)PageWord << 1), Endpoint_Read_Word_LE()); } /* Write the filled FLASH page to memory */