esp32: Add support to build with ESP-IDF v4.2.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2021-02-15 21:00:09 +11:00
parent d191d88cab
commit a915002177
2 changed files with 13 additions and 1 deletions

View File

@ -28,7 +28,7 @@ manage the ESP32 microcontroller, as well as a way to manage the required
build environment and toolchains needed to build the firmware.
The ESP-IDF changes quickly and MicroPython only supports certain versions.
Currently MicroPython supports v4.0.2 and v4.1.1,
Currently MicroPython supports v4.0.2, v4.1.1 and v4.2,
although other IDF v4 versions may also work.
To install the ESP-IDF the full instructions can be found at the

View File

@ -108,6 +108,11 @@ if(IDF_VERSION_MINOR GREATER_EQUAL 1)
list(APPEND IDF_COMPONENTS esp_netif)
endif()
if(IDF_VERSION_MINOR GREATER_EQUAL 2)
list(APPEND IDF_COMPONENTS esp_system)
list(APPEND IDF_COMPONENTS esp_timer)
endif()
# Register the main IDF component.
idf_component_register(
SRCS
@ -169,5 +174,12 @@ foreach(comp ${IDF_COMPONENTS})
endif()
endforeach()
if(IDF_VERSION_MINOR GREATER_EQUAL 2)
# 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)
list(APPEND MICROPY_CPP_INC_EXTRA ${IDF_PATH}/components/soc/soc/include)
endif()
# Include the main MicroPython cmake rules.
include(${MICROPY_DIR}/py/mkrules.cmake)