@@ -2,28 +2,16 @@ 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})
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
project(${PROJECT})
|
||||
|
||||
project(${PROJECT})
|
||||
|
||||
else()
|
||||
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
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
|
||||
|
@@ -1,17 +1,3 @@
|
||||
# FAMILY = esp32sx
|
||||
idf_component_register(SRCS "main.c"
|
||||
INCLUDE_DIRS "."
|
||||
REQUIRES freertos soc)
|
||||
|
||||
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"
|
||||
)
|
||||
REQUIRES boards tinyusb_src)
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#include "bsp/board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF PROTYPES
|
||||
// MACRO CONSTANT TYPEDEF PROTOTYPES
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
/* Blink pattern
|
||||
|
@@ -1,10 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
# needed for esp32sx build. TODO could be removed later on
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
@@ -16,7 +11,6 @@ project(${PROJECT})
|
||||
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Check for -DFAMILY=
|
||||
if(FAMILY MATCHES "^esp32s[2-3]")
|
||||
else()
|
||||
if(NOT FAMILY STREQUAL "espressif")
|
||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
||||
endif()
|
||||
|
@@ -1,35 +1,3 @@
|
||||
idf_component_register(SRCS "main.c" "usb_descriptors.c" "msc_disk.c"
|
||||
INCLUDE_DIRS "."
|
||||
REQUIRES freertos soc)
|
||||
|
||||
file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake)
|
||||
|
||||
if(EXISTS ${board_cmake})
|
||||
include(${board_cmake})
|
||||
endif()
|
||||
|
||||
target_include_directories(${COMPONENT_TARGET} PUBLIC
|
||||
"${TOP}/hw"
|
||||
"${TOP}/src"
|
||||
)
|
||||
|
||||
target_compile_definitions(${COMPONENT_TARGET} PUBLIC
|
||||
ESP_PLATFORM
|
||||
)
|
||||
|
||||
target_sources(${COMPONENT_TARGET} PUBLIC
|
||||
"${TOP}/src/tusb.c"
|
||||
"${TOP}/src/common/tusb_fifo.c"
|
||||
"${TOP}/src/device/usbd.c"
|
||||
"${TOP}/src/device/usbd_control.c"
|
||||
"${TOP}/src/class/cdc/cdc_device.c"
|
||||
"${TOP}/src/class/dfu/dfu_rt_device.c"
|
||||
"${TOP}/src/class/hid/hid_device.c"
|
||||
"${TOP}/src/class/midi/midi_device.c"
|
||||
"${TOP}/src/class/msc/msc_device.c"
|
||||
"${TOP}/src/class/net/ecm_rndis_device.c"
|
||||
"${TOP}/src/class/net/ncm_device.c"
|
||||
"${TOP}/src/class/usbtmc/usbtmc_device.c"
|
||||
"${TOP}/src/class/vendor/vendor_device.c"
|
||||
"${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c"
|
||||
)
|
||||
REQUIRES boards tinyusb_src)
|
||||
|
@@ -54,7 +54,9 @@
|
||||
#endif
|
||||
|
||||
// This examples use FreeRTOS
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_FREERTOS
|
||||
#endif
|
||||
|
||||
// Espressif IDF requires "freertos/" prefix in include path
|
||||
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||
|
@@ -1,17 +1,16 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
# use BOARD-Directory name for project id
|
||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
set(PROJECT ${BOARD}-${PROJECT})
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
project(${PROJECT})
|
||||
|
||||
# Checks this example is valid for the family and initializes the project
|
||||
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Check for -DFAMILY=
|
||||
if(FAMILY MATCHES "^esp32s[2-3]")
|
||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
||||
project(${PROJECT})
|
||||
else()
|
||||
if(NOT FAMILY STREQUAL "espressif")
|
||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
||||
endif()
|
||||
|
@@ -1,35 +1,3 @@
|
||||
idf_component_register(SRCS "main.c" "usb_descriptors.c"
|
||||
INCLUDE_DIRS "."
|
||||
REQUIRES freertos soc)
|
||||
|
||||
file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake)
|
||||
|
||||
if(EXISTS ${board_cmake})
|
||||
include(${board_cmake})
|
||||
endif()
|
||||
|
||||
target_include_directories(${COMPONENT_TARGET} PUBLIC
|
||||
"${TOP}/hw"
|
||||
"${TOP}/src"
|
||||
)
|
||||
|
||||
target_compile_definitions(${COMPONENT_TARGET} PUBLIC
|
||||
ESP_PLATFORM
|
||||
)
|
||||
|
||||
target_sources(${COMPONENT_TARGET} PUBLIC
|
||||
"${TOP}/src/tusb.c"
|
||||
"${TOP}/src/common/tusb_fifo.c"
|
||||
"${TOP}/src/device/usbd.c"
|
||||
"${TOP}/src/device/usbd_control.c"
|
||||
"${TOP}/src/class/cdc/cdc_device.c"
|
||||
"${TOP}/src/class/dfu/dfu_rt_device.c"
|
||||
"${TOP}/src/class/hid/hid_device.c"
|
||||
"${TOP}/src/class/midi/midi_device.c"
|
||||
"${TOP}/src/class/msc/msc_device.c"
|
||||
"${TOP}/src/class/net/ecm_rndis_device.c"
|
||||
"${TOP}/src/class/net/ncm_device.c"
|
||||
"${TOP}/src/class/usbtmc/usbtmc_device.c"
|
||||
"${TOP}/src/class/vendor/vendor_device.c"
|
||||
"${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c"
|
||||
)
|
||||
REQUIRES boards tinyusb_src)
|
||||
|
@@ -54,7 +54,9 @@
|
||||
#endif
|
||||
|
||||
// This examples use FreeRTOS
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_FREERTOS
|
||||
#endif
|
||||
|
||||
// Espressif IDF requires "freertos/" prefix in include path
|
||||
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||
|
Reference in New Issue
Block a user