Actual check for eeprom board identifier is correct
This commit is contained in:
parent
7ccdd5a90d
commit
10f7fe1a68
|
@ -142,6 +142,9 @@ bool isEEPROMContentValid(void)
|
|||
if (temp->size != sizeof(master_t) || temp->magic_be != 0xBE || temp->magic_ef != 0xEF)
|
||||
return false;
|
||||
|
||||
if (strncasecmp(temp->boardIdentifier, TARGET_BOARD_IDENTIFIER, sizeof(TARGET_BOARD_IDENTIFIER)))
|
||||
return false;
|
||||
|
||||
// verify integrity of temporary copy
|
||||
checksum = calculateChecksum((const uint8_t *) temp, sizeof(master_t));
|
||||
if (checksum != 0)
|
||||
|
|
|
@ -838,7 +838,7 @@ void createDefaultConfig(master_t *config)
|
|||
resetStatusLedConfig(&config->statusLedConfig);
|
||||
|
||||
/* merely to force a reset if the person inadvertently flashes the wrong target */
|
||||
strncpy(config->boardIdentifier, TARGET_BOARD_IDENTIFIER, MIN(sizeof(TARGET_BOARD_IDENTIFIER), sizeof(config->boardIdentifier)));
|
||||
strncpy(config->boardIdentifier, TARGET_BOARD_IDENTIFIER, sizeof(TARGET_BOARD_IDENTIFIER));
|
||||
|
||||
#if defined(TARGET_CONFIG)
|
||||
targetConfiguration(config);
|
||||
|
|
Loading…
Reference in New Issue