diff --git a/CMakeLists.txt b/CMakeLists.txt index a9518366..92e6afba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,11 +21,7 @@ else() set(submake "make") endif() -if (${IDF_VERSION_MAJOR} EQUAL 5) - set(CMAKE_C_STANDARD 17) -else() - set(CMAKE_C_STANDARD 11) -endif() +set(CMAKE_C_STANDARD 17) set(APP_COLCON_META "${PROJECT_DIR}/app-colcon.meta") if(NOT EXISTS "${APP_COLCON_META}") diff --git a/examples/low_consumption/main/main.c b/examples/low_consumption/main/main.c index cd7528ef..33a58df3 100644 --- a/examples/low_consumption/main/main.c +++ b/examples/low_consumption/main/main.c @@ -119,22 +119,19 @@ void app_main(void) // Configure dynamic frequency scaling: // maximum and minimum frequencies are set in sdkconfig, // automatic light sleep is enabled if tickless idle support is enabled. -#ifdef CONFIG_IDF_TARGET_ESP32S2 - esp_pm_config_esp32s2_t pm_config = {}; -#elif CONFIG_IDF_TARGET_ESP32C3 - esp_pm_config_esp32c3_t pm_config = {}; -#else - esp_pm_config_esp32_t pm_config = {}; -#endif + esp_pm_config_t pm_config = {}; pm_config.max_freq_mhz = 240; + #ifdef CONFIG_IDF_TARGET_ESP32S2 pm_config.min_freq_mhz = 10; #else pm_config.min_freq_mhz = 20; -#endif +#endif /* CONFIG_IDF_TARGET_ESP32S2 */ + #if CONFIG_FREERTOS_USE_TICKLESS_IDLE pm_config.light_sleep_enable = true; -#endif +#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */ + ESP_ERROR_CHECK(esp_pm_configure(&pm_config)); #endif /* CONFIG_PM_ENABLE */