mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-07 05:54:11 +08:00
make saola as cmake component, easier to add more esp32 board
This commit is contained in:
parent
cefbd9579c
commit
16dbbb2b4f
@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.5)
|
|||||||
set(TOP "../../..")
|
set(TOP "../../..")
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
get_filename_component(TOP "${TOP}" REALPATH)
|
||||||
|
|
||||||
# Add example src and bsp directories
|
# Add example src and bsp directories
|
||||||
set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2_saola_1")
|
set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2_saola_1")
|
||||||
|
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
# CMakeLists in this exact order for cmake to work correctly
|
# CMakeLists in this exact order for cmake to work correctly
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
# example src directory
|
|
||||||
set(EXTRA_COMPONENT_DIRS "src")
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
# TOP is absolute path to root directory of TinyUSB git repo
|
||||||
set(TOP "../../..")
|
set(TOP "../../..")
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
get_filename_component(TOP "${TOP}" REALPATH)
|
||||||
|
|
||||||
|
# Add example src and bsp directories
|
||||||
|
set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2_saola_1")
|
||||||
|
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
set(SUPPORTED_TARGETS esp32s2)
|
set(SUPPORTED_TARGETS esp32s2)
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ idf_component_register(SRCS "main.c" "usb_descriptors.c" "msc_disk.c"
|
|||||||
|
|
||||||
target_compile_options(${COMPONENT_TARGET} PUBLIC
|
target_compile_options(${COMPONENT_TARGET} PUBLIC
|
||||||
"-DCFG_TUSB_MCU=OPT_MCU_ESP32S2"
|
"-DCFG_TUSB_MCU=OPT_MCU_ESP32S2"
|
||||||
"-DCFG_TUSB_OS=OPT_OS_FREERTOS"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
|
idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
|
||||||
@ -15,7 +14,6 @@ target_include_directories(${COMPONENT_TARGET} PUBLIC
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_sources(${COMPONENT_TARGET} PUBLIC
|
target_sources(${COMPONENT_TARGET} PUBLIC
|
||||||
"${TOP}/hw/bsp/esp32s2_saola_1/esp32s2_saola_1.c"
|
|
||||||
"${TOP}/src/tusb.c"
|
"${TOP}/src/tusb.c"
|
||||||
"${TOP}/src/common/tusb_fifo.c"
|
"${TOP}/src/common/tusb_fifo.c"
|
||||||
"${TOP}/src/device/usbd.c"
|
"${TOP}/src/device/usbd.c"
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
# CMakeLists in this exact order for cmake to work correctly
|
# CMakeLists in this exact order for cmake to work correctly
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
# example src directory
|
|
||||||
set(EXTRA_COMPONENT_DIRS "src")
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
# TOP is absolute path to root directory of TinyUSB git repo
|
||||||
set(TOP "../../..")
|
set(TOP "../../..")
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
get_filename_component(TOP "${TOP}" REALPATH)
|
||||||
|
|
||||||
|
# Add example src and bsp directories
|
||||||
|
set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2_saola_1")
|
||||||
|
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
set(SUPPORTED_TARGETS esp32s2)
|
set(SUPPORTED_TARGETS esp32s2)
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ idf_component_register(SRCS "main.c" "usb_descriptors.c"
|
|||||||
|
|
||||||
target_compile_options(${COMPONENT_TARGET} PUBLIC
|
target_compile_options(${COMPONENT_TARGET} PUBLIC
|
||||||
"-DCFG_TUSB_MCU=OPT_MCU_ESP32S2"
|
"-DCFG_TUSB_MCU=OPT_MCU_ESP32S2"
|
||||||
"-DCFG_TUSB_OS=OPT_OS_FREERTOS"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
|
idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
|
||||||
@ -15,7 +14,6 @@ target_include_directories(${COMPONENT_TARGET} PUBLIC
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_sources(${COMPONENT_TARGET} PUBLIC
|
target_sources(${COMPONENT_TARGET} PUBLIC
|
||||||
"${TOP}/hw/bsp/esp32s2_saola_1/esp32s2_saola_1.c"
|
|
||||||
"${TOP}/src/tusb.c"
|
"${TOP}/src/tusb.c"
|
||||||
"${TOP}/src/common/tusb_fifo.c"
|
"${TOP}/src/common/tusb_fifo.c"
|
||||||
"${TOP}/src/device/usbd.c"
|
"${TOP}/src/device/usbd.c"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user