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 049ebf9853
commit f3adbf9953
5 changed files with 81 additions and 35 deletions

View File

@@ -15,7 +15,6 @@
#include "soc/rtc.h"
#include "esp_wpa.h"
#include "esp_netif.h"
#include "driver/adc.h"
#include "esp_coexist_internal.h"
#include "esp_phy_init.h"
#include "phy.h"
@@ -56,7 +55,6 @@ uint64_t g_wifi_feature_caps =
#endif
0;
static bool s_wifi_adc_xpd_flag;
static const char* TAG = "wifi_init";
@@ -278,24 +276,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)
{