esp_phy: use spinlock to avoid regi2c access conflicts

This commit is contained in:
Michael (XIAO Xufeng)
2022-03-01 16:12:45 +08:00
parent 92d6c4a502
commit 75c720bcd3
8 changed files with 100 additions and 54 deletions

View File

@@ -23,7 +23,6 @@
#include "esp_wpa.h"
#include "esp_netif.h"
#include "tcpip_adapter_compatible/tcpip_adapter_compat.h"
#include "driver/adc.h"
#include "driver/adc2_wifi_private.h"
#include "esp_coexist_internal.h"
#include "esp_phy_init.h"
@@ -64,7 +63,6 @@ uint64_t g_wifi_feature_caps =
#endif
0;
static bool s_wifi_adc_xpd_flag;
static const char* TAG = "wifi_init";
@@ -290,24 +288,6 @@ void wifi_apb80m_release(void)
}
#endif //CONFIG_PM_ENABLE
/* Coordinate ADC power with other modules. This overrides the function from PHY lib. */
// It seems that it is only required on ESP32, but we still compile it for all chips, in case it is
// called by PHY unexpectedly.
void set_xpd_sar(bool en)
{
if (s_wifi_adc_xpd_flag == en) {
/* ignore repeated calls to set_xpd_sar when the state is already correct */
return;
}
s_wifi_adc_xpd_flag = en;
if (en) {
adc_power_acquire();
} else {
adc_power_release();
}
}
#ifndef CONFIG_ESP_WIFI_FTM_ENABLE
void ieee80211_ftm_attach(void)
{