Fixed DFU bootloader programming not discarding the correct number of filler bytes...
[pub/lufa.git] / Bootloaders / DFU / BootloaderDFU.c
index 553a5a2..157b78f 100644 (file)
@@ -205,8 +205,8 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
                                        /* Throw away the filler bytes before the start of the firmware */\r
                                        DiscardFillerBytes(DFU_FILLER_BYTES_SIZE);\r
 \r
-                                       /* Throw away the page alignment filler bytes before the start of the firmware */\r
-                                       DiscardFillerBytes(StartAddr % SPM_PAGESIZE);\r
+                                       /* Throw away the packet alignment filler bytes before the start of the firmware */\r
+                                       DiscardFillerBytes(StartAddr % FIXED_CONTROL_ENDPOINT_SIZE);\r
                                        \r
                                        /* Calculate the number of bytes remaining to be written */\r
                                        uint16_t BytesRemaining = ((EndAddr - StartAddr) + 1);\r