wifi: run adc2 calibration on C3

This commit is contained in:
Michael (XIAO Xufeng) 2021-01-04 12:25:24 +08:00 committed by Armando
parent 3fde25374a
commit c257daa950
2 changed files with 9 additions and 4 deletions

View File

@ -43,14 +43,21 @@ esp_err_t adc2_wifi_acquire(void);
*/
esp_err_t adc2_wifi_release(void);
#if CONFIG_IDF_TARGET_ESP32S2
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32C3
/**
* @brief This API help ADC2 calibration constructor be linked.
*
* @note This is a private function, Don't call `adc2_cal_include` in user code.
*/
void adc2_cal_include(void);
#endif //CONFIG_IDF_TARGET_ESP32S2
#else
/**
* @brief There's no calibration involved on this chip.
*
* @note This is a private function, Don't call `adc2_cal_include` in user code.
*/
#define adc2_cal_include()
#endif //CONFIG_IDF_TARGET_*
#ifdef __cplusplus
}

View File

@ -247,9 +247,7 @@ esp_err_t esp_wifi_init(const wifi_init_config_t *config)
return result;
}
}
#if CONFIG_IDF_TARGET_ESP32S2
adc2_cal_include(); //This enables the ADC2 calibration constructor at start up.
#endif
esp_wifi_config_info();
return result;
}