Skip to content

Commit eecadcf

Browse files
authored
Fix some idf version issues (#370)
1 parent 7f69ed1 commit eecadcf

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ else()
2121
set(submake "make")
2222
endif()
2323

24-
if (${IDF_VERSION_MAJOR} EQUAL 5)
25-
set(CMAKE_C_STANDARD 17)
26-
else()
27-
set(CMAKE_C_STANDARD 11)
28-
endif()
24+
set(CMAKE_C_STANDARD 17)
2925

3026
set(APP_COLCON_META "${PROJECT_DIR}/app-colcon.meta")
3127
if(NOT EXISTS "${APP_COLCON_META}")

‎examples/low_consumption/main/main.c‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,19 @@ void app_main(void)
120120
// Configure dynamic frequency scaling:
121121
// maximum and minimum frequencies are set in sdkconfig,
122122
// automatic light sleep is enabled if tickless idle support is enabled.
123-
#ifdef CONFIG_IDF_TARGET_ESP32S2
124-
esp_pm_config_esp32s2_t pm_config = {};
125-
#elif CONFIG_IDF_TARGET_ESP32C3
126-
esp_pm_config_esp32c3_t pm_config = {};
127-
#else
128-
esp_pm_config_esp32_t pm_config = {};
129-
#endif
123+
esp_pm_config_t pm_config = {};
130124
pm_config.max_freq_mhz = 240;
125+
131126
#ifdef CONFIG_IDF_TARGET_ESP32S2
132127
pm_config.min_freq_mhz = 10;
133128
#else
134129
pm_config.min_freq_mhz = 20;
135-
#endif
130+
#endif /* CONFIG_IDF_TARGET_ESP32S2 */
131+
136132
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
137133
pm_config.light_sleep_enable = true;
138-
#endif
134+
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
135+
139136
ESP_ERROR_CHECK(esp_pm_configure(&pm_config));
140137
#endif /* CONFIG_PM_ENABLE */
141138

0 commit comments

Comments
 (0)