aboutsummaryrefslogtreecommitdiffstats
path: root/Bootloaders
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2013-11-03 15:44:55 +0100
committerDean Camera <dean@fourwalledcubicle.com>2013-11-03 15:44:55 +0100
commit6b214472b72db5f777529f59a2c090635338b9fb (patch)
tree09d9cb7cf519868c8c5f0e9c20bd71455207ec9d /Bootloaders
parentbcd07f4f8a1413c0d6150a0bbeb3a712b8636ed1 (diff)
downloadlufa-6b214472b72db5f777529f59a2c090635338b9fb.tar.gz
lufa-6b214472b72db5f777529f59a2c090635338b9fb.tar.bz2
lufa-6b214472b72db5f777529f59a2c090635338b9fb.zip
Fix signature bytes in the DFU class bootloader.
Diffstat (limited to 'Bootloaders')
-rw-r--r--Bootloaders/DFU/BootloaderDFU.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c
index f19fa03ed..00532d03c 100644
--- a/Bootloaders/DFU/BootloaderDFU.c
+++ b/Bootloaders/DFU/BootloaderDFU.c
@@ -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];
+ }
}