fix(esp_phy): Add protection of consecutive disable operations by single modem source

This commit is contained in:
Wang Mengyang
2025-08-15 07:21:09 +08:00
parent 5d20d91dac
commit f26341ac93
3 changed files with 18 additions and 3 deletions
+2 -1
View File
@@ -357,8 +357,9 @@ void esp_phy_disable(esp_phy_modem_t modem)
#if CONFIG_ESP_PHY_RECORD_USED_TIME
phy_record_time(false, modem);
#endif
esp_phy_modem_t saved_modem = phy_get_modem_flag();
phy_clr_modem_flag(modem);
if (phy_get_modem_flag() == 0) {
if (saved_modem == modem) {
// ESP32 will track pll in the wifi/BT modem interrupt handler.
#if !CONFIG_IDF_TARGET_ESP32 && !CONFIG_ESP_PHY_DISABLE_PLL_TRACK
phy_track_pll_deinit();