summaryrefslogtreecommitdiff
path: root/examples/device/board_test
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-03-30 10:41:11 +0700
committerhathach <[email protected]>2023-03-30 10:41:11 +0700
commit641613c428e10a029b172c318d4db077e35fee7d (patch)
treec607eaaa3822fe522bf57f0d24e858fb782b7d81 /examples/device/board_test
parent96718b7ca08d1d74cf1ecfb3816b57df50bf1616 (diff)
update all cmake for esp32 build
Diffstat (limited to 'examples/device/board_test')
-rw-r--r--examples/device/board_test/CMakeLists.txt27
-rw-r--r--examples/device/board_test/src/CMakeLists.txt16
-rw-r--r--examples/device/board_test/src/main.c2
3 files changed, 15 insertions, 30 deletions
diff --git a/examples/device/board_test/CMakeLists.txt b/examples/device/board_test/CMakeLists.txt
index 37113578e..b21d56f9e 100644
--- a/examples/device/board_test/CMakeLists.txt
+++ b/examples/device/board_test/CMakeLists.txt
@@ -1,29 +1,24 @@
cmake_minimum_required(VERSION 3.5)
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# Check for -DFAMILY=
-if(FAMILY MATCHES "^esp32s[2-3]")
- # use BOARD-Directory name for project id
- get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
- set(PROJECT ${BOARD}-${PROJECT})
-
+# -DFAMILY=espressif
+if(FAMILY STREQUAL "espressif")
# TOP is absolute path to root directory of TinyUSB git repo
set(TOP "../../..")
get_filename_component(TOP "${TOP}" REALPATH)
+endif()
- project(${PROJECT})
-
-else()
+include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
- # gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
- family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
+# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
+family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
- project(${PROJECT})
+project(${PROJECT})
- # Checks this example is valid for the family and initializes the project
- family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
+# Checks this example is valid for the family and initializes the project
+family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
+# Other family such as rp2040
+if(NOT FAMILY STREQUAL "espressif")
add_executable(${PROJECT})
# Example source
diff --git a/examples/device/board_test/src/CMakeLists.txt b/examples/device/board_test/src/CMakeLists.txt
index 37625f441..03f4c7505 100644
--- a/examples/device/board_test/src/CMakeLists.txt
+++ b/examples/device/board_test/src/CMakeLists.txt
@@ -1,17 +1,7 @@
-# FAMILY = esp32sx
idf_component_register(SRCS "main.c"
INCLUDE_DIRS "."
- REQUIRES freertos soc)
+ REQUIRES freertos soc tinyusb_src)
-file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake)
-
-if(EXISTS ${board_cmake})
- include(${board_cmake})
-endif()
-
-idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
target_include_directories(${COMPONENT_TARGET} PUBLIC
- "${FREERTOS_ORIG_INCLUDE_PATH}"
- "${TOP}/hw"
- "${TOP}/src"
-)
+ "${TOP}/hw"
+ )
diff --git a/examples/device/board_test/src/main.c b/examples/device/board_test/src/main.c
index 3f8d55c52..b11f6f2bb 100644
--- a/examples/device/board_test/src/main.c
+++ b/examples/device/board_test/src/main.c
@@ -30,7 +30,7 @@
#include "bsp/board.h"
//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
+// MACRO CONSTANT TYPEDEF PROTOTYPES
//--------------------------------------------------------------------+
/* Blink pattern