Fixed DFU bootloader programming not discarding the correct number of filler bytes...
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 24 Jan 2010 13:38:20 +0000 (13:38 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 24 Jan 2010 13:38:20 +0000 (13:38 +0000)
Bootloaders/DFU/BootloaderDFU.c
LUFA/ManPages/ChangeLog.txt
Projects/TemperatureDataLogger/TempDataLogger.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
index 6a2126f..e5bdbb3 100644 (file)
@@ -41,6 +41,8 @@
   *  - Fixed invalid USB controller PLL prescaler values for the ATMEGAxxU2 controllers\r
   *  - Fixed lack of support for the ATMEGA32U2 in the DFU and CDC class bootloaders\r
   *  - Fixed Benito project not resetting the target AVR automatically when programming has completed\r
+  *  - Fixed DFU bootloader programming not discarding the correct number of filler bytes from the host when non-aligned programming\r
+  *    ranges are specified (thanks to Thomas Bleeker)\r
   *\r
   *  \section Sec_ChangeLog091223 Version 091223\r
   *\r
index 538a6a5..2f2e8da 100644 (file)
@@ -96,6 +96,7 @@ FATFS DiskFATState;
 FIL TempLogFile;\r
 \r
 \r
+/** ISR to handle the 500ms ticks for sampling and data logging */\r
 ISR(TIMER1_COMPA_vect, ISR_BLOCK)\r
 {\r
        uint8_t LEDMask = LEDs_GetLEDs();\r
@@ -157,6 +158,7 @@ int main(void)
        }\r
 }\r
 \r
+/** Opens the log file on the Dataflash's FAT formatted partition according to the current date */\r
 void OpenLogFile(void)\r
 {\r
        char LogFileName[12];\r
@@ -172,6 +174,7 @@ void OpenLogFile(void)
        f_lseek(&TempLogFile, TempLogFile.fsize);\r
 }\r
 \r
+/** Closes the open data log file on the Dataflash's FAT formatted partition */\r
 void CloseLogFile(void)\r
 {\r
        /* Sync any data waiting to be written, unmount the storage device */\r
@@ -301,6 +304,7 @@ void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDI
        DS1307_SetDate(ReportParams->Day,  ReportParams->Month,  ReportParams->Year);\r
        DS1307_SetTime(ReportParams->Hour, ReportParams->Minute, ReportParams->Second);\r
        \r
+       /* If the logging interval has changed from its current value, write it to EEPROM */\r
        if (LoggingInterval500MS_SRAM != ReportParams->LogInterval500MS)\r
        {\r
                LoggingInterval500MS_SRAM = ReportParams->LogInterval500MS;\r