diff --git a/tasmota/settings.h b/tasmota/settings.h index 54057090a..fffc9eaa0 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -759,7 +759,7 @@ typedef struct { uint8_t zb_channel; // F32 int8_t zb_txradio_dbm; // F33 uint16_t pms_wake_interval; // F34 - uint8_t config_version; // F36 + uint8_t config_version; // F36 Setting mem layout identifier for different ESP types - don't move! uint8_t windmeter_pulses_x_rot; // F37 uint16_t windmeter_radius; // F38 uint16_t windmeter_pulse_debounce; // F3A diff --git a/tasmota/settings.ino b/tasmota/settings.ino index a0cc34555..173b438b3 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -439,13 +439,16 @@ bool SettingsConfigRestore(void) { } if (valid_settings) { -#ifdef ESP8266 // uint8_t config_version; // F36 +#ifdef ESP8266 valid_settings = (0 == settings_buffer[0xF36]); // Settings->config_version #endif // ESP8266 #ifdef ESP32 - // uint8_t config_version; // F36 +#ifdef CONFIG_IDF_TARGET_ESP32C3 + valid_settings = (2 == settings_buffer[0xF36]); // Settings->config_version +#else valid_settings = (1 == settings_buffer[0xF36]); // Settings->config_version +#endif // CONFIG_IDF_TARGET_ESP32C3 #endif // ESP32 } @@ -825,7 +828,11 @@ void SettingsDefaultSet2(void) { // Settings->config_version = 0; // ESP8266 (Has been 0 for long time) #endif // ESP8266 #ifdef ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32C3 + Settings->config_version = 2; // ESP32C3 +#else Settings->config_version = 1; // ESP32 +#endif // CONFIG_IDF_TARGET_ESP32C3 #endif // ESP32 flag.stop_flash_rotate |= APP_FLASH_CYCLE; @@ -1347,7 +1354,11 @@ void SettingsDelta(void) { Settings->config_version = 0; // ESP8266 (Has been 0 for long time) #endif // ESP8266 #ifdef ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32C3 + Settings->config_version = 2; // ESP32C3 +#else Settings->config_version = 1; // ESP32 +#endif // CONFIG_IDF_TARGET_ESP32C3 #endif // ESP32 } if (Settings->version < 0x08020006) {