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().
This commit is contained in:
Magnus von Wachenfeldt 2021-11-04 14:50:39 +01:00 committed by Damien George
parent ff4f1f3ab3
commit 6d9da27c21
2 changed files with 9 additions and 5 deletions

View File

@ -134,7 +134,7 @@ STATIC void machine_timer_isr(void *self_in) {
#if HAVE_TIMER_LL
#if CONFIG_IDF_TARGET_ESP32
#if CONFIG_IDF_TARGET_ESP32 && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
device->hw_timer[self->index].update = 1;
#else
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
@ -148,7 +148,11 @@ STATIC void machine_timer_isr(void *self_in) {
#endif
#endif
timer_ll_clear_intr_status(device, self->index);
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
timer_ll_set_alarm_enable(device, self->index, self->repeat);
#else
timer_ll_set_alarm_value(device, self->index, self->repeat);
#endif
#else

View File

@ -121,16 +121,16 @@ set(IDF_COMPONENTS
xtensa
)
if(IDF_VERSION_MINOR GREATER_EQUAL 1)
if(IDF_VERSION_MINOR GREATER_EQUAL 1 OR IDF_VERSION_MAJOR GREATER_EQUAL 5)
list(APPEND IDF_COMPONENTS esp_netif)
endif()
if(IDF_VERSION_MINOR GREATER_EQUAL 2)
if(IDF_VERSION_MINOR GREATER_EQUAL 2 OR IDF_VERSION_MAJOR GREATER_EQUAL 5)
list(APPEND IDF_COMPONENTS esp_system)
list(APPEND IDF_COMPONENTS esp_timer)
endif()
if(IDF_VERSION_MINOR GREATER_EQUAL 3)
if(IDF_VERSION_MINOR GREATER_EQUAL 3 OR IDF_VERSION_MAJOR GREATER_EQUAL 5)
list(APPEND IDF_COMPONENTS esp_hw_support)
list(APPEND IDF_COMPONENTS esp_pm)
list(APPEND IDF_COMPONENTS hal)
@ -203,7 +203,7 @@ foreach(comp ${IDF_COMPONENTS})
micropy_gather_target_properties(__idf_${comp})
endforeach()
if(IDF_VERSION_MINOR GREATER_EQUAL 2)
if(IDF_VERSION_MINOR GREATER_EQUAL 2 OR IDF_VERSION_MAJOR GREATER_EQUAL 5)
# These paths cannot currently be found by the IDF_COMPONENTS search loop above,
# so add them explicitly.
list(APPEND MICROPY_CPP_INC_EXTRA ${IDF_PATH}/components/soc/soc/${IDF_TARGET}/include)