examples/wifi/power_save: enable tickless idle

This commit is contained in:
Ivan Grokhotkov 2018-05-04 01:31:15 +08:00 committed by bot
parent 45d3b1f4b1
commit 12230b7292
2 changed files with 6 additions and 1 deletions

View 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

View 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