feat(nvs_flash): Modify for ESP8266

This commit is contained in:
Dong Heng
2021-07-23 17:21:22 +08:00
parent f09d86123d
commit f25a7ad205
16 changed files with 42 additions and 50 deletions

View File

@@ -68,4 +68,10 @@
#define _COUNTER_STRINGIFY(COUNTER) #COUNTER
#ifdef IDF_CI_BUILD
#define IDF_DEPRECATED(REASON) __attribute__((deprecated(REASON)))
#else
#define IDF_DEPRECATED(REASON)
#endif
#endif /* __ESP_ATTR_H__ */

View File

@@ -204,15 +204,15 @@ static const char* PHY_NAMESPACE = "phy";
static const char* PHY_CAL_DATA_KEY = "cal_data";
static const char* PHY_RX_GAIN_DC_TABLE_KEY = "dc_table";
static esp_err_t load_cal_data_from_nvs_handle(nvs_handle handle,
static esp_err_t load_cal_data_from_nvs_handle(nvs_handle_t handle,
esp_phy_calibration_data_t* out_cal_data);
static esp_err_t store_cal_data_to_nvs_handle(nvs_handle handle,
static esp_err_t store_cal_data_to_nvs_handle(nvs_handle_t handle,
const esp_phy_calibration_data_t* cal_data);
esp_err_t esp_phy_load_cal_data_from_nvs(esp_phy_calibration_data_t* out_cal_data)
{
nvs_handle handle;
nvs_handle_t handle;
esp_err_t err = nvs_open(PHY_NAMESPACE, NVS_READONLY, &handle);
if (err == ESP_ERR_NVS_NOT_INITIALIZED) {
@@ -230,7 +230,7 @@ esp_err_t esp_phy_load_cal_data_from_nvs(esp_phy_calibration_data_t* out_cal_dat
esp_err_t esp_phy_store_cal_data_to_nvs(const esp_phy_calibration_data_t* cal_data)
{
nvs_handle handle;
nvs_handle_t handle;
esp_err_t err = nvs_open(PHY_NAMESPACE, NVS_READWRITE, &handle);
if (err != ESP_OK) {
@@ -243,7 +243,7 @@ esp_err_t esp_phy_store_cal_data_to_nvs(const esp_phy_calibration_data_t* cal_da
}
}
static esp_err_t load_cal_data_from_nvs_handle(nvs_handle handle,
static esp_err_t load_cal_data_from_nvs_handle(nvs_handle_t handle,
esp_phy_calibration_data_t* out_cal_data)
{
esp_err_t err;
@@ -278,7 +278,7 @@ static esp_err_t load_cal_data_from_nvs_handle(nvs_handle handle,
return ESP_OK;
}
static esp_err_t store_cal_data_to_nvs_handle(nvs_handle handle,
static esp_err_t store_cal_data_to_nvs_handle(nvs_handle_t handle,
const esp_phy_calibration_data_t* cal_data)
{
esp_err_t err;

View File

@@ -136,7 +136,7 @@ static const char *BACKUP_MAC_DATA_KEY = "backup_mac_data";
static esp_err_t load_backup_mac_data(uint8_t *mac)
{
esp_err_t err;
nvs_handle handle;
nvs_handle_t handle;
uint32_t efuse[4];
uint8_t efuse_crc = 0;
uint8_t calc_crc = 0;
@@ -221,7 +221,7 @@ static esp_err_t load_backup_mac_data(uint8_t *mac)
static esp_err_t store_backup_mac_data()
{
esp_err_t err;
nvs_handle handle;
nvs_handle_t handle;
uint32_t efuse[4];
efuse[0] = REG_READ(EFUSE_DATA0_REG);
efuse[1] = REG_READ(EFUSE_DATA1_REG);