From a8e005336e3eefdf6f6190679f7613322fbce7bf Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 12 Nov 2020 17:50:34 +0100 Subject: [PATCH] Use valid function for cal_data erase --- tasmota/support_esp32.ino | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tasmota/support_esp32.ino b/tasmota/support_esp32.ino index e84cc06d9..1180e5f34 100644 --- a/tasmota/support_esp32.ino +++ b/tasmota/support_esp32.ino @@ -87,6 +87,7 @@ void ESP_Restart(void) { #include #include +#include void NvmLoad(const char *sNvsName, const char *sName, void *pSettings, unsigned nSettingsLen) { nvs_handle handle; @@ -121,20 +122,20 @@ esp_err_t NvmErase(const char *sNvsName) { void SettingsErase(uint8_t type) { // All SDK and Tasmota data is held in default NVS partition - // - + // cal_data - SDK PHY calibration data as documented in esp_phy_init.h + // qpc - Tasmota Quick Power Cycle state + // main - Tasmota Settings data esp_err_t r1, r2, r3; switch (type) { case 0: // Reset 2, 5, 6 = Erase all flash from program end to end of physical flash // nvs_flash_erase(); // Erase RTC, PHY, sta.mac, ap.sndchan, ap.mac, Tasmota etc. r1 = NvmErase("qpc"); r2 = NvmErase("main"); -// NvmErase("cal_data"); AddLog_P(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_ERASE " Tasmota data (%d,%d)"), r1, r2); break; case 1: case 4: // Reset 3 or WIFI_FORCE_RF_CAL_ERASE = SDK parameter area -// r1 = esp_phy_erase_cal_data_in_nvs(); - r1 = NvmErase("cal_data"); + r1 = esp_phy_erase_cal_data_in_nvs(); +// r1 = NvmErase("cal_data"); AddLog_P(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_ERASE " PHY data (%d)"), r1); break; case 2: // Not used = QPC and Tasmota parameter area (0x0F3xxx - 0x0FBFFF)