From 59e279c6556b7a558bae2c229acaeec8bc65a1df Mon Sep 17 00:00:00 2001 From: Marcio Ribeiro Date: Thu, 26 Sep 2024 17:23:34 -0300 Subject: [PATCH] drivers: wifi: esp32: adc2 init code calibration Add call to adc2_init_code_calibration during wifi initialization on esp32s2 and esp32c3 Signed-off-by: Marcio Ribeiro --- drivers/wifi/esp32/src/esp_wifi_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/wifi/esp32/src/esp_wifi_drv.c b/drivers/wifi/esp32/src/esp_wifi_drv.c index db9de0dbdf1531..861cbef6b52efe 100644 --- a/drivers/wifi/esp32/src/esp_wifi_drv.c +++ b/drivers/wifi/esp32/src/esp_wifi_drv.c @@ -27,6 +27,10 @@ LOG_MODULE_REGISTER(esp32_wifi, CONFIG_WIFI_LOG_LEVEL); #include #include "wifi/wifi_event.h" +#if CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3 +#include +#endif /* CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3 */ + #define DHCPV4_MASK (NET_EVENT_IPV4_DHCP_BOUND | NET_EVENT_IPV4_DHCP_STOP) /* use global iface pointer to support any ethernet driver */ @@ -862,6 +866,10 @@ static int esp32_wifi_stats(const struct device *dev, struct net_stats_wifi *sta static int esp32_wifi_dev_init(const struct device *dev) { +#if CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3 + adc2_init_code_calibration(); +#endif /* CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3 */ + esp_timer_init(); wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT(); esp_err_t ret = esp_wifi_init(&config);