aboutsummaryrefslogtreecommitdiffstats
path: root/Bootloaders/HID/BootloaderHID.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-02-10 17:55:49 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-02-10 17:55:49 +0000
commit782614dbb55addcae8c9d4d9e1ce3dec81287282 (patch)
treebb4ba0005e5b7687d6866ea70ee899d772d04b1b /Bootloaders/HID/BootloaderHID.c
parent57b382558d0f2a5146bea735943f09c6d1b83286 (diff)
downloadlufa-782614dbb55addcae8c9d4d9e1ce3dec81287282.tar.gz
lufa-782614dbb55addcae8c9d4d9e1ce3dec81287282.tar.bz2
lufa-782614dbb55addcae8c9d4d9e1ce3dec81287282.zip
Add static keyword to all project globals whose scope should be restricted to the same module as they are declared in.
Tighten up the HID class bootloader code slightly, document that it currently exceeds 2KB of bootloader space for all models other than the Series 2 USB AVRs.
Diffstat (limited to 'Bootloaders/HID/BootloaderHID.c')
-rw-r--r--Bootloaders/HID/BootloaderHID.c6
1 files changed, 3 insertions, 3 deletions
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 */