From deba35d2e5a22a15fb943aecccd60b545ba1de07 Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Fri, 12 Apr 2019 15:33:33 +0530 Subject: [PATCH] cpu_start: fix warnings with CONFIG_PM_DFS_INIT_AUTO option Closes https://github.com/espressif/esp-idf/issues/3297 --- components/esp32/cpu_start.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index 7e45abb037..f18a70ff35 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -393,11 +393,10 @@ void start_cpu0_default(void) #ifdef CONFIG_PM_ENABLE esp_pm_impl_init(); #ifdef CONFIG_PM_DFS_INIT_AUTO - rtc_cpu_freq_t max_freq; - rtc_clk_cpu_freq_from_mhz(CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ, &max_freq); + int xtal_freq = (int) rtc_clk_xtal_freq_get(); esp_pm_config_esp32_t cfg = { - .max_cpu_freq = max_freq, - .min_cpu_freq = RTC_CPU_FREQ_XTAL + .max_freq_mhz = CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ, + .min_freq_mhz = xtal_freq, }; esp_pm_configure(&cfg); #endif //CONFIG_PM_DFS_INIT_AUTO