Merge pull request #14705 from curzon01/development

Add ESP32C3 setting identifier
This commit is contained in:
Theo Arends 2022-02-03 13:19:09 +01:00 committed by GitHub
commit 572fc3b1f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View File

@ -759,7 +759,7 @@ typedef struct {
uint8_t zb_channel; // F32 uint8_t zb_channel; // F32
int8_t zb_txradio_dbm; // F33 int8_t zb_txradio_dbm; // F33
uint16_t pms_wake_interval; // F34 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 uint8_t windmeter_pulses_x_rot; // F37
uint16_t windmeter_radius; // F38 uint16_t windmeter_radius; // F38
uint16_t windmeter_pulse_debounce; // F3A uint16_t windmeter_pulse_debounce; // F3A

View File

@ -439,13 +439,16 @@ bool SettingsConfigRestore(void) {
} }
if (valid_settings) { if (valid_settings) {
#ifdef ESP8266
// uint8_t config_version; // F36 // uint8_t config_version; // F36
#ifdef ESP8266
valid_settings = (0 == settings_buffer[0xF36]); // Settings->config_version valid_settings = (0 == settings_buffer[0xF36]); // Settings->config_version
#endif // ESP8266 #endif // ESP8266
#ifdef ESP32 #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 valid_settings = (1 == settings_buffer[0xF36]); // Settings->config_version
#endif // CONFIG_IDF_TARGET_ESP32C3
#endif // ESP32 #endif // ESP32
} }
@ -825,7 +828,11 @@ void SettingsDefaultSet2(void) {
// Settings->config_version = 0; // ESP8266 (Has been 0 for long time) // Settings->config_version = 0; // ESP8266 (Has been 0 for long time)
#endif // ESP8266 #endif // ESP8266
#ifdef ESP32 #ifdef ESP32
#ifdef CONFIG_IDF_TARGET_ESP32C3
Settings->config_version = 2; // ESP32C3
#else
Settings->config_version = 1; // ESP32 Settings->config_version = 1; // ESP32
#endif // CONFIG_IDF_TARGET_ESP32C3
#endif // ESP32 #endif // ESP32
flag.stop_flash_rotate |= APP_FLASH_CYCLE; 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) Settings->config_version = 0; // ESP8266 (Has been 0 for long time)
#endif // ESP8266 #endif // ESP8266
#ifdef ESP32 #ifdef ESP32
#ifdef CONFIG_IDF_TARGET_ESP32C3
Settings->config_version = 2; // ESP32C3
#else
Settings->config_version = 1; // ESP32 Settings->config_version = 1; // ESP32
#endif // CONFIG_IDF_TARGET_ESP32C3
#endif // ESP32 #endif // ESP32
} }
if (Settings->version < 0x08020006) { if (Settings->version < 0x08020006) {