fix(esp_phy): check hw freq hop done before disabling common clock

This commit is contained in:
zwx
2026-05-15 15:12:06 +08:00
parent f5e77bfb4f
commit 4fb37541a0
5 changed files with 16 additions and 1 deletions
@@ -240,6 +240,13 @@ void phy_wakeup_from_modem_state_extra_init(void);
void esp_phy_modem_rf_flag_update(void); void esp_phy_modem_rf_flag_update(void);
#endif #endif
/**
* @brief Wait for frequency hardware hop to complete
*
*/
void phy_wait_freq_hw_hop_done(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
+6
View File
@@ -323,3 +323,9 @@ void phy_wakeup_from_modem_state_extra_init(void)
temperature_sensor_ll_enable(true); temperature_sensor_ll_enable(true);
} }
#endif #endif
__attribute__((weak)) void phy_wait_freq_hw_hop_done(void)
{
ESP_LOGD(TAG, "phy_wait_freq_hw_hop_done is not implemented");
return;
}
+1
View File
@@ -420,6 +420,7 @@ void esp_phy_disable(esp_phy_modem_t modem)
// Update WiFi MAC time before disable WiFi/BT common peripheral clock // Update WiFi MAC time before disable WiFi/BT common peripheral clock
phy_update_wifi_mac_time(true, esp_timer_get_time()); phy_update_wifi_mac_time(true, esp_timer_get_time());
#endif #endif
phy_wait_freq_hw_hop_done();
// Disable WiFi/BT common peripheral clock. Do not disable clock for hardware RNG // Disable WiFi/BT common peripheral clock. Do not disable clock for hardware RNG
esp_phy_common_clock_disable(); esp_phy_common_clock_disable();
} }
@@ -153,6 +153,7 @@ void esp_phy_disable(esp_phy_modem_t modem)
#endif #endif
phy_close_rf(); phy_close_rf();
phy_xpd_tsens(); phy_xpd_tsens();
phy_wait_freq_hw_hop_done();
#if SOC_MODEM_CLOCK_IS_INDEPENDENT #if SOC_MODEM_CLOCK_IS_INDEPENDENT
modem_clock_module_disable(PERIPH_PHY_MODULE); modem_clock_module_disable(PERIPH_PHY_MODULE);
#endif #endif