1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 22:05:17 +03:00

Fix for reset on save

This commit is contained in:
blckmn 2017-07-29 20:59:13 +10:00
parent 03caa1cc8d
commit 3846dd5cf6
3 changed files with 7 additions and 6 deletions

View file

@ -141,11 +141,6 @@ bool isEEPROMContentValid(void)
eepromConfigSize = p - &__config_start; 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 // 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; return crc == CRC_CHECK_VALUE;
} }

View file

@ -2969,9 +2969,10 @@ static void cliVersion(char *cmdline)
{ {
UNUSED(cmdline); UNUSED(cmdline);
cliPrintLinef("# %s / %s %s %s / %s (%s)", cliPrintLinef("# %s / %s (%s) %s %s / %s (%s)",
FC_FIRMWARE_NAME, FC_FIRMWARE_NAME,
targetName, targetName,
systemConfig()->boardIdentifier,
FC_VERSION_STRING, FC_VERSION_STRING,
buildDate, buildDate,
buildTime, buildTime,

View file

@ -265,6 +265,11 @@ void init(void)
ensureEEPROMContainsValidData(); ensureEEPROMContainsValidData();
readEEPROM(); 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 defined(STM32F4) && !defined(DISABLE_OVERCLOCK)
// If F4 Overclocking is set and System core clock is not correct a reset is forced // If F4 Overclocking is set and System core clock is not correct a reset is forced
if (systemConfig()->cpu_overclock && SystemCoreClock != OC_FREQUENCY_HZ) { if (systemConfig()->cpu_overclock && SystemCoreClock != OC_FREQUENCY_HZ) {