Fix signature bytes in the DFU class bootloader.
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 3 Nov 2013 14:44:55 +0000 (15:44 +0100)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 3 Nov 2013 14:44:55 +0000 (15:44 +0100)
Bootloaders/DFU/BootloaderDFU.c
LUFA/DoxygenPages/ChangeLog.txt

index f19fa03..00532d0 100644 (file)
@@ -785,13 +785,20 @@ static void ProcessWriteCommand(void)
 static void ProcessReadCommand(void)
 {
        const uint8_t BootloaderInfo[3] = {BOOTLOADER_VERSION, BOOTLOADER_ID_BYTE1, BOOTLOADER_ID_BYTE2};
-       const uint8_t SignatureInfo[3]  = {AVR_SIGNATURE_1,    AVR_SIGNATURE_2,     AVR_SIGNATURE_3};
+       const uint8_t SignatureInfo[4]  = {0x58, AVR_SIGNATURE_1, AVR_SIGNATURE_2, AVR_SIGNATURE_3};
 
        uint8_t DataIndexToRead = SentCommand.Data[1];
 
-       if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x00))                         // Read bootloader info
-         ResponseByte = BootloaderInfo[DataIndexToRead];
+       if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x00))                        // Read bootloader info
+       {
+               ResponseByte = BootloaderInfo[DataIndexToRead];
+       }
        else if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x01))                    // Read signature byte
-         ResponseByte = SignatureInfo[DataIndexToRead - 0x30];
+       {
+               if (DataIndexToRead < 0x60)
+                 ResponseByte = SignatureInfo[DataIndexToRead - 0x30];
+               else
+                 ResponseByte = SignatureInfo[DataIndexToRead - 0x60 + 3];
+       }
 }
 
index a2ae1c2..a81eff6 100644 (file)
@@ -15,6 +15,7 @@
   *  - Library Applications:
   *   - Refactored out USB interface IDs in the demo applications into enums (thanks to Laszlo Monda)
   *   - AVRISP-MKII Clone Project PDI/TPI frequency increased from 250KHz to 2MHz as it is now stable
+  *   - Fixed incorrect signature bytes returned in the DFU bootloader
   *
   *  \section Sec_ChangeLog130901 Version 130901
   *  <b>New:</b>