Fix for flashing incorrect target, and wrong defaults persisting in flash.

This commit is contained in:
blckmn 2017-01-05 21:50:43 +11:00
parent 56f0083237
commit 7ccdd5a90d
2 changed files with 4 additions and 0 deletions

View File

@ -241,6 +241,7 @@ typedef struct master_s {
uint32_t preferred_beeper_off_flags;
char name[MAX_NAME_LENGTH + 1];
char boardIdentifier[sizeof(TARGET_BOARD_IDENTIFIER)];
uint8_t magic_ef; // magic number, should be 0xEF
uint8_t chk; // XOR checksum

View File

@ -837,6 +837,9 @@ 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)));
#if defined(TARGET_CONFIG)
targetConfiguration(config);
#endif