Get signature bytes from system headers

This commit is contained in:
Olaf Rempel 2019-11-03 18:04:46 +01:00
parent f4ef7a7b1e
commit 5ba6367a37
1 changed files with 1 additions and 9 deletions

10
main.c
View File

@ -23,20 +23,12 @@
#if defined (__AVR_ATmega8__) #if defined (__AVR_ATmega8__)
#define VERSION_STRING "TWIBOOT m8v2.1" #define VERSION_STRING "TWIBOOT m8v2.1"
#define SIGNATURE_BYTES 0x1E, 0x93, 0x07
#elif defined (__AVR_ATmega88__) #elif defined (__AVR_ATmega88__)
#define VERSION_STRING "TWIBOOT m88v2.1" #define VERSION_STRING "TWIBOOT m88v2.1"
#define SIGNATURE_BYTES 0x1E, 0x93, 0x0A
#elif defined (__AVR_ATmega168__) #elif defined (__AVR_ATmega168__)
#define VERSION_STRING "TWIBOOT m168v2.1" #define VERSION_STRING "TWIBOOT m168v2.1"
#define SIGNATURE_BYTES 0x1E, 0x94, 0x06
#elif defined (__AVR_ATmega328P__) #elif defined (__AVR_ATmega328P__)
#define VERSION_STRING "TWIBOOTm328pv2.1" #define VERSION_STRING "TWIBOOTm328pv2.1"
#define SIGNATURE_BYTES 0x1E, 0x95, 0x0F
#else #else
#error MCU not supported #error MCU not supported
#endif #endif
@ -135,7 +127,7 @@
const static uint8_t info[16] = VERSION_STRING; const static uint8_t info[16] = VERSION_STRING;
const static uint8_t chipinfo[8] = { const static uint8_t chipinfo[8] = {
SIGNATURE_BYTES, SIGNATURE_0, SIGNATURE_1, SIGNATURE_2,
SPM_PAGESIZE, SPM_PAGESIZE,
(BOOTLOADER_START >> 8) & 0xFF, (BOOTLOADER_START >> 8) & 0xFF,