]> granicus.if.org Git - esp-idf/commitdiff
cpu_start: fix warnings with CONFIG_PM_DFS_INIT_AUTO option
authorMahavir Jain <mahavir@espressif.com>
Fri, 12 Apr 2019 10:03:33 +0000 (15:33 +0530)
committerMahavir Jain <mahavir@espressif.com>
Tue, 16 Apr 2019 05:51:26 +0000 (11:21 +0530)
Closes https://github.com/espressif/esp-idf/issues/3297

components/esp32/cpu_start.c

index 53306206674fd43f5a402b4c9a4898b2fda58dcb..de74b26ed5941c85f867e0542ca1557e4be7a647 100644 (file)
@@ -372,11 +372,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