From: Sergey Vlasov Date: Sun, 26 Sep 2021 09:58:48 +0000 (+0300) Subject: AVRISP-MKII Clone: Add EEPROM magic number validation X-Git-Url: http://git.linex4red.de/pub/lufa.git/commitdiff_plain/24e03fb4d1ec3337bfdf14ae5a08ba96841eaaa9?hp=24e03fb4d1ec3337bfdf14ae5a08ba96841eaaa9 AVRISP-MKII Clone: Add EEPROM magic number validation If the compiled AVRISP-MKII Clone firmware is flashed into a previously used chip without writing the corresponding initial EEPROM data, the code could not detect that the stored parameter data was not valid, and blindly used whatever values were left in the EEPROM. This was especially problematic when the reset polarity happened to be set wrongly, because avrdude does not have any options to set that parameter (it sends the corresponding commands only if it detects STK500 or STK600, and does not send that command for AVRISP-MKII). Add a check for a 4-byte magic number in the EEPROM, so that any data which was left there by some different code could be properly ignored and erased before using the EEPROM storage for AVRISP-MKII Clone data. ---