mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
phy: fix phy pwdet and tsens power cannot be set twice issue
Closes https://github.com/espressif/esp-idf/issues/11627
This commit is contained in:
parent
213504238f
commit
21ce7c16a0
@ -18,6 +18,8 @@
|
||||
*/
|
||||
|
||||
static bool s_wifi_adc_xpd_flag;
|
||||
static bool s_wifi_pwdet_xpd_flag;
|
||||
static bool s_wifi_tsens_xpd_flag;
|
||||
|
||||
void include_esp_phy_override(void)
|
||||
{
|
||||
@ -55,6 +57,12 @@ IRAM_ATTR void phy_i2c_exit_critical(void)
|
||||
|
||||
void phy_set_pwdet_power(bool en)
|
||||
{
|
||||
if (s_wifi_pwdet_xpd_flag == en) {
|
||||
/* ignore repeated calls to phy_set_pwdet_power when the state is already correct */
|
||||
return;
|
||||
}
|
||||
|
||||
s_wifi_pwdet_xpd_flag = en;
|
||||
if (en) {
|
||||
sar_periph_ctrl_pwdet_power_acquire();
|
||||
} else {
|
||||
@ -64,6 +72,12 @@ void phy_set_pwdet_power(bool en)
|
||||
|
||||
void phy_set_tsens_power(bool en)
|
||||
{
|
||||
if (s_wifi_tsens_xpd_flag == en) {
|
||||
/* ignore repeated calls to phy_set_tsens_power when the state is already correct */
|
||||
return;
|
||||
}
|
||||
|
||||
s_wifi_tsens_xpd_flag = en;
|
||||
if (en) {
|
||||
temperature_sensor_power_acquire();
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user