From 777816cb99874b9c7f53ad93365fd5fffbefd364 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 7 Feb 2017 15:14:45 +0800 Subject: [PATCH] =?UTF-8?q?phy=5Finit:=20don=E2=80=99t=20rewrite=20valid?= =?UTF-8?q?=20calibration=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the default PHY init routine, calibration data is loaded from NVS. Most of the time the incremental changes to calibration will be fairly small, so we don’t need to rewrite the existing calibration data stored in the NVS. Possible enhancement to be done in the future: expose a function in PHY library to tell how big was the change in calibration data. If the change was significant, then calibration data stored in NVS should be updated. --- components/esp32/cpu_start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index 001d1706e..5278f9b16 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -294,7 +294,7 @@ static void do_phy_init() esp_phy_init(init_data, calibration_mode, cal_data); - if (calibration_mode != PHY_RF_CAL_NONE) { + if (calibration_mode != PHY_RF_CAL_NONE && err != ESP_OK) { err = esp_phy_store_cal_data_to_nvs(cal_data); } else { err = ESP_OK;