Merge branch 'feat/set_cpu_freq_after_pm_config_changed' into 'master'

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

Closes IDFGH-12481

See merge request espressif/esp-idf!29963
This commit is contained in:
Wu Zheng Hui
2024-04-07 13:47:20 +08:00
2 changed files with 5 additions and 8 deletions

View File

@@ -470,6 +470,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;
}
@@ -619,7 +620,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;
}