X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/4ba40977162ef46f328d49c4d48d7d8a0c6cddf0..c69a6236529416aa134cbfcd04a8f05eff987948:/Bootloaders/DFU/BootloaderDFU.c diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c index f19fa03ed..0385bfc49 100644 --- a/Bootloaders/DFU/BootloaderDFU.c +++ b/Bootloaders/DFU/BootloaderDFU.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2014. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -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]; + } }