8000 esp32: Support building with latest IDF v5. · salewski/micropython@6d9da27 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6d9da27

Browse files
brutusmcforcedpgeorge
authored andcommitted
esp32: Support building with latest IDF v5.
The latest ESP-IDF v5.0-dev declares MAJOR_VERSION 5 and MINOR_VERSION 0. timer_ll_set_alarm_enable() is also changed to timer_ll_set_alarm_value().
1 parent ff4f1f3 commit 6d9da27

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

ports/esp32/machine_timer.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ STATIC void machine_timer_isr(void *self_in) {
134134

135135
#if HAVE_TIMER_LL
136136

137-
#if CONFIG_IDF_TARGET_ESP32
137+
#if CONFIG_IDF_TARGET_ESP32 && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
138138
device->hw_timer[self->index].update = 1;
139139
#else
140140
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
@@ -148,7 +148,11 @@ STATIC void machine_timer_isr(void *self_in) {
148148
#endif
149149
#endif
150150
timer_ll_clear_intr_status(device, self->index);
151+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
151152
timer_ll_set_alarm_enable(device, self->index, self->repeat);
153+
#else
154+
timer_ll_set_alarm_value(device, self->index, self->repeat);
155+
#endif
152156

153157
#else
154158

ports/esp32/main/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,16 @@ set(IDF_COMPONENTS
121121
xtensa
122122
)
123123

124-
if(IDF_VERSION_MINOR GREATER_EQUAL 1)
124+
if(IDF_VERSION_MINOR GREATER_EQUAL 1 OR IDF_VERSION_MAJOR GREATER_EQUAL 5)
125125
list(APPEND IDF_COMPONENTS esp_netif)
126126
endif()
127127

128-
if(IDF_VERSION_MINOR GREATER_EQUAL 2)
128+
if(IDF_VERSION_MINOR GREATER_EQUAL 2 OR IDF_VERSION_MAJOR GREATER_EQUAL 5)
129129
list(APPEND IDF_COMPONENTS esp_system)
130130
list(APPEND IDF_COMPONENTS esp_timer)
131131
endif()
132132

133-
if(IDF_VERSION_MINOR GREATER_EQUAL 3)
133+
if(IDF_VERSION_MINOR GREATER_EQUAL 3 OR IDF_VERSION_MAJOR GREATER_EQUAL 5)
134134
list(APPEND IDF_COMPONENTS esp_hw_support)
135135
list(APPEND IDF_COMPONENTS esp_pm)
136136
list(APPEND IDF_COMPONENTS hal)
@@ -203,7 +203,7 @@ foreach(comp ${IDF_COMPONENTS})
203203
micropy_gather_target_properties(__idf_${comp})
204204
endforeach()
205205

206-
if(IDF_VERSION_MINOR GREATER_EQUAL 2)
206+
if(IDF_VERSION_MINOR GREATER_EQUAL 2 OR IDF_VERSION_MAJOR GREATER_EQUAL 5)
207207
# These paths cannot currently be found by the IDF_COMPONENTS search loop above,
208208
# so add them explicitly.
209209
list(APPEND MICROPY_CPP_INC_EXTRA ${IDF_PATH}/components/soc/soc/${IDF_TARGET}/include)

0 commit comments

Comments
 (0)
0