]> granicus.if.org Git - esp-idf/commitdiff
examples/wifi/power_save: enable tickless idle
authorIvan Grokhotkov <ivan@espressif.com>
Thu, 3 May 2018 17:31:15 +0000 (01:31 +0800)
committerbot <bot@espressif.com>
Fri, 18 May 2018 03:14:46 +0000 (03:14 +0000)
examples/wifi/power_save/main/power_save.c
examples/wifi/power_save/sdkconfig.defaults

index 507994b2cc56efff42d61101f26a2043ee259cc3..f40b898bcf99956222e9cdd06772c9a7b0314934 100644 (file)
@@ -102,7 +102,10 @@ void app_main()
     rtc_clk_cpu_freq_from_mhz(CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ, &max_freq);
     esp_pm_config_esp32_t pm_config = {
             .max_cpu_freq = max_freq,
-            .min_cpu_freq = RTC_CPU_FREQ_XTAL
+            .min_cpu_freq = RTC_CPU_FREQ_XTAL,
+#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
+            .light_sleep_enable = true
+#endif
     };
     ESP_ERROR_CHECK( esp_pm_configure(&pm_config) );
 #endif // CONFIG_PM_ENABLE
index 0c212b1df69e297f2912bc2914bc975be3f5f74b..d39e7c8321628f4c37f33403713e7f10598b21e7 100644 (file)
@@ -2,5 +2,7 @@
 CONFIG_ESP32_DEFAULT_CPU_FREQ_80=y
 # Enable support for power management
 CONFIG_PM_ENABLE=y
+# Enable tickless idle mode
+CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
 # Use RTC timer as reference
 CONFIG_PM_USE_RTC_TIMER_REF=y