diff options
| author | Alex Lisitsyn <[email protected]> | 2021-04-16 13:37:14 +0200 |
|---|---|---|
| committer | Alex Lisitsyn <[email protected]> | 2021-04-16 15:41:42 +0200 |
| commit | f5e02e72ed8e6dae5ce854263fdca86ac7453e3c (patch) | |
| tree | 0364e7fdda32374af84bb989bfb1f961ed0fc878 /examples/device/board_test | |
| parent | 2f0cb8b5f1a944187635a58a748ed08738d324a5 (diff) | |
espressif: group boards using target name as a family
`hw\bsp` separate one family folder to esp32s2, esp32s3
add board specific board.cmake file to override board specific options(features)
fix examples and test scripts to use new family approach
Diffstat (limited to 'examples/device/board_test')
| -rw-r--r-- | examples/device/board_test/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/board_test/src/CMakeLists.txt | 13 |
2 files changed, 4 insertions, 11 deletions
diff --git a/examples/device/board_test/CMakeLists.txt b/examples/device/board_test/CMakeLists.txt index 7658fae49..2b7712630 100644 --- a/examples/device/board_test/CMakeLists.txt +++ b/examples/device/board_test/CMakeLists.txt @@ -7,7 +7,7 @@ set(TOP "../../..") get_filename_component(TOP "${TOP}" REALPATH) # Check for -DFAMILY= -if(FAMILY STREQUAL "esp32sx") +if(FAMILY MATCHES "^(esp32s[2-3])*") cmake_minimum_required(VERSION 3.5) include(${TOP}/hw/bsp/${FAMILY}/family.cmake) diff --git a/examples/device/board_test/src/CMakeLists.txt b/examples/device/board_test/src/CMakeLists.txt index e44863609..e4e1f4e9a 100644 --- a/examples/device/board_test/src/CMakeLists.txt +++ b/examples/device/board_test/src/CMakeLists.txt @@ -3,19 +3,12 @@ idf_component_register(SRCS "main.c" INCLUDE_DIRS "." REQUIRES freertos soc) -string(REGEX MATCH "^(esp32s[2-3])*" chip_target "$ENV{IDF_TARGET}") +file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake) -if(NOT chip_target) - message(FATAL_ERROR "Incorrect target: $ENV{IDF_TARGET}" ) +if(EXISTS ${board_cmake}) + include(${board_cmake}) endif() -string(TOUPPER ${chip_target} upper_case_target) - -target_compile_options(${COMPONENT_TARGET} PUBLIC - "-DCFG_TUSB_MCU=OPT_MCU_${upper_case_target}" - "-DCFG_TUSB_OS=OPT_OS_FREERTOS" -) - idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH) target_include_directories(${COMPONENT_TARGET} PUBLIC "${FREERTOS_ORIG_INCLUDE_PATH}" |
