Skip to content

Commit c20e43c

Browse files
wmrsouzaaescolar
authored andcommitted
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 <[email protected]>
1 parent b7a4bb3 commit c20e43c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/wifi/esp32/src/esp_wifi_drv.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ LOG_MODULE_REGISTER(esp32_wifi, CONFIG_WIFI_LOG_LEVEL);
2727
#include <esp_mac.h>
2828
#include "wifi/wifi_event.h"
2929

30+
#if CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3
31+
#include <esp_private/adc_share_hw_ctrl.h>
32+
#endif /* CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3 */
33+
3034
#define DHCPV4_MASK (NET_EVENT_IPV4_DHCP_BOUND | NET_EVENT_IPV4_DHCP_STOP)
3135

3236
/* 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
862866

863867
static int esp32_wifi_dev_init(const struct device *dev)
864868
{
869+
#if CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3
870+
adc2_init_code_calibration();
871+
#endif /* CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3 */
872+
865873
esp_timer_init();
866874
wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT();
867875
esp_err_t ret = esp_wifi_init(&config);

0 commit comments

Comments
 (0)