doc: add documentation for RF calibration

Add an API to erase phy namespace of NVS
This commit is contained in:
Xia Xiaotian
2018-11-29 16:07:28 +08:00
committed by XiaXiaotian
parent a134141320
commit 59761b0fcb
6 changed files with 99 additions and 1 deletions

View File

@@ -471,6 +471,30 @@ esp_err_t esp_phy_store_cal_data_to_nvs(const esp_phy_calibration_data_t* cal_da
}
}
esp_err_t esp_phy_erase_cal_data_in_nvs(void)
{
nvs_handle handle;
esp_err_t err = nvs_open(PHY_NAMESPACE, NVS_READWRITE, &handle);
if (err != ESP_OK) {
ESP_LOGE(TAG, "%s: failed to open NVS phy namespace (0x%x)", __func__, err);
return err;
}
else {
err = nvs_erase_all(handle);
if (err != ESP_OK) {
ESP_LOGE(TAG, "%s: failed to erase NVS phy namespace (0x%x)", __func__, err);
}
else {
err = nvs_commit(handle);
if (err != ESP_OK) {
ESP_LOGE(TAG, "%s: failed to commit NVS phy namespace (0x%x)", __func__, err);
}
}
}
nvs_close(handle);
return err;
}
static esp_err_t load_cal_data_from_nvs_handle(nvs_handle handle,
esp_phy_calibration_data_t* out_cal_data)
{