fix(esp_hw_support): update LACT clock prescale immediately when APB changes on esp32

This commit is contained in:
wuzhenghui
2025-05-16 16:30:11 +08:00
parent 9b9103c5bb
commit 52296887bf
5 changed files with 61 additions and 39 deletions

View File

@@ -555,12 +555,14 @@ void IRAM_ATTR esp_pm_impl_switch_mode(pm_mode_t mode,
*/
static void IRAM_ATTR on_freq_update(uint32_t old_ticks_per_us, uint32_t ticks_per_us)
{
#if !CONFIG_IDF_TARGET_ESP32
uint32_t old_apb_ticks_per_us = MIN(old_ticks_per_us, 80);
uint32_t apb_ticks_per_us = MIN(ticks_per_us, 80);
/* Update APB frequency value used by the timer */
if (old_apb_ticks_per_us != apb_ticks_per_us) {
esp_timer_private_update_apb_freq(apb_ticks_per_us);
}
#endif
#ifdef CONFIG_FREERTOS_SYSTICK_USES_CCOUNT
#ifdef XT_RTOS_TIMER_INT