fix(esp_pm): update CPU frequency immediately after updating pm_config

Closes https://github.com/espressif/esp-idf/issues/13492
This commit is contained in:
wuzhenghui
2024-04-01 17:49:34 +08:00
parent f231b262b9
commit 1a676d1e77
2 changed files with 5 additions and 8 deletions

View File

@@ -468,6 +468,7 @@ esp_err_t esp_pm_configure(const void* vconfig)
s_config_changed = true;
portEXIT_CRITICAL(&s_switch_lock);
do_switch(PM_MODE_CPU_MAX);
return ESP_OK;
}
@@ -617,7 +618,7 @@ static void IRAM_ATTR do_switch(pm_mode_t new_mode)
#endif
portEXIT_CRITICAL_ISR(&s_switch_lock);
} while (true);
if (new_mode == s_mode) {
if ((new_mode == s_mode) && !s_config_changed) {
portEXIT_CRITICAL_ISR(&s_switch_lock);
return;
}