Skip to content

Commit

Permalink
drivers: wifi: esp32: adc2 init code calibration
Browse files Browse the repository at this point in the history
Add call to adc2_init_code_calibration during wifi initialization on
esp32s2 and esp32c3

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
  • Loading branch information
wmrsouza committed Sep 26, 2024
1 parent 9488605 commit db211d2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/wifi/esp32/src/esp_wifi_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ LOG_MODULE_REGISTER(esp32_wifi, CONFIG_WIFI_LOG_LEVEL);
#include <esp_mac.h>
#include "wifi/wifi_event.h"

#if CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3
#include <esp_private/adc_share_hw_ctrl.h>
#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 */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit db211d2

Please sign in to comment.