From 3846dd5cf62d1928bb5d51b237b4a03fec797ef4 Mon Sep 17 00:00:00 2001 From: blckmn Date: Sat, 29 Jul 2017 20:59:13 +1000 Subject: [PATCH] Fix for reset on save --- src/main/config/config_eeprom.c | 5 ----- src/main/fc/cli.c | 3 ++- src/main/fc/fc_init.c | 5 +++++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/config/config_eeprom.c b/src/main/config/config_eeprom.c index ca1f5335f0..42e05f7b7e 100644 --- a/src/main/config/config_eeprom.c +++ b/src/main/config/config_eeprom.c @@ -141,11 +141,6 @@ bool isEEPROMContentValid(void) eepromConfigSize = p - &__config_start; - /* TODO: Check to be removed when moving to generic targets */ - if (strncasecmp(systemConfig()->boardIdentifier, TARGET_BOARD_IDENTIFIER, sizeof(TARGET_BOARD_IDENTIFIER))) { - return false; - } - // CRC has the property that if the CRC itself is included in the calculation the resulting CRC will have constant value return crc == CRC_CHECK_VALUE; } diff --git a/src/main/fc/cli.c b/src/main/fc/cli.c index fc084132d6..1245bdd6e9 100755 --- a/src/main/fc/cli.c +++ b/src/main/fc/cli.c @@ -2969,9 +2969,10 @@ static void cliVersion(char *cmdline) { UNUSED(cmdline); - cliPrintLinef("# %s / %s %s %s / %s (%s)", + cliPrintLinef("# %s / %s (%s) %s %s / %s (%s)", FC_FIRMWARE_NAME, targetName, + systemConfig()->boardIdentifier, FC_VERSION_STRING, buildDate, buildTime, diff --git a/src/main/fc/fc_init.c b/src/main/fc/fc_init.c index dab0336721..b886bbc2a4 100644 --- a/src/main/fc/fc_init.c +++ b/src/main/fc/fc_init.c @@ -265,6 +265,11 @@ void init(void) ensureEEPROMContainsValidData(); readEEPROM(); + /* TODO: Check to be removed when moving to generic targets */ + if (strncasecmp(systemConfig()->boardIdentifier, TARGET_BOARD_IDENTIFIER, sizeof(TARGET_BOARD_IDENTIFIER))) { + resetEEPROM(); + } + #if defined(STM32F4) && !defined(DISABLE_OVERCLOCK) // If F4 Overclocking is set and System core clock is not correct a reset is forced if (systemConfig()->cpu_overclock && SystemCoreClock != OC_FREQUENCY_HZ) {