mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-21 21:41:09 +00:00
more rp2040 family clean up
This commit is contained in:
parent
8aa28e63fb
commit
a61d0f074f
@ -14,10 +14,6 @@ set(FAMILY_MCUS RP2040)
|
|||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake)
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
|
||||||
#set(TOP "${CMAKE_CURRENT_LIST_DIR}/../../..")
|
|
||||||
#get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
if (NOT PICO_TINYUSB_PATH)
|
if (NOT PICO_TINYUSB_PATH)
|
||||||
set(PICO_TINYUSB_PATH ${TOP})
|
set(PICO_TINYUSB_PATH ${TOP})
|
||||||
endif()
|
endif()
|
||||||
@ -38,29 +34,30 @@ target_sources(tinyusb_common_base INTERFACE
|
|||||||
|
|
||||||
target_include_directories(tinyusb_common_base INTERFACE
|
target_include_directories(tinyusb_common_base INTERFACE
|
||||||
${TOP}/src
|
${TOP}/src
|
||||||
${TOP}/src/common
|
|
||||||
${TOP}/hw
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(tinyusb_common_base INTERFACE
|
if(DEFINED LOG)
|
||||||
hardware_structs
|
set(TINYUSB_DEBUG_LEVEL ${LOG})
|
||||||
hardware_irq
|
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
hardware_resets
|
|
||||||
pico_sync
|
|
||||||
)
|
|
||||||
|
|
||||||
set(TINYUSB_DEBUG_LEVEL 0)
|
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
||||||
message("Compiling TinyUSB with CFG_TUSB_DEBUG=1")
|
message("Compiling TinyUSB with CFG_TUSB_DEBUG=1")
|
||||||
set(TINYUSB_DEBUG_LEVEL 1)
|
set(TINYUSB_DEBUG_LEVEL 1)
|
||||||
|
else ()
|
||||||
|
set(TINYUSB_DEBUG_LEVEL 0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_definitions(tinyusb_common_base INTERFACE
|
target_compile_definitions(tinyusb_common_base INTERFACE
|
||||||
CFG_TUSB_MCU=OPT_MCU_RP2040
|
CFG_TUSB_MCU=OPT_MCU_RP2040
|
||||||
CFG_TUSB_OS=${TINYUSB_OPT_OS}
|
CFG_TUSB_OS=${TINYUSB_OPT_OS}
|
||||||
#CFG_TUSB_DEBUG=${TINYUSB_DEBUG_LEVEL}
|
CFG_TUSB_DEBUG=${TINYUSB_DEBUG_LEVEL}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(tinyusb_common_base INTERFACE
|
||||||
|
hardware_structs
|
||||||
|
hardware_irq
|
||||||
|
hardware_resets
|
||||||
|
pico_sync
|
||||||
|
)
|
||||||
|
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
# Base config for device mode; wrapped by SDK's tinyusb_device
|
# Base config for device mode; wrapped by SDK's tinyusb_device
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
@ -109,10 +106,11 @@ target_compile_definitions(tinyusb_host_base INTERFACE
|
|||||||
#------------------------------------
|
#------------------------------------
|
||||||
add_library(tinyusb_bsp INTERFACE)
|
add_library(tinyusb_bsp INTERFACE)
|
||||||
target_sources(tinyusb_bsp INTERFACE
|
target_sources(tinyusb_bsp INTERFACE
|
||||||
${TOP}/hw/bsp/rp2040/family.c
|
${TOP}/hw/bsp/rp2040/family.c
|
||||||
)
|
)
|
||||||
# target_include_directories(tinyusb_bsp INTERFACE
|
target_include_directories(tinyusb_bsp INTERFACE
|
||||||
# ${TOP}/hw/bsp/rp2040)
|
${TOP}/hw
|
||||||
|
)
|
||||||
|
|
||||||
# tinyusb_additions will hold our extra settings for examples
|
# tinyusb_additions will hold our extra settings for examples
|
||||||
add_library(tinyusb_additions INTERFACE)
|
add_library(tinyusb_additions INTERFACE)
|
||||||
@ -122,10 +120,6 @@ target_compile_definitions(tinyusb_additions INTERFACE
|
|||||||
PICO_RP2040_USB_DEVICE_UFRAME_FIX=1
|
PICO_RP2040_USB_DEVICE_UFRAME_FIX=1
|
||||||
)
|
)
|
||||||
|
|
||||||
if(DEFINED LOG)
|
|
||||||
target_compile_definitions(tinyusb_additions INTERFACE CFG_TUSB_DEBUG=${LOG})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(LOGGER STREQUAL "RTT" OR LOGGER STREQUAL "rtt")
|
if(LOGGER STREQUAL "RTT" OR LOGGER STREQUAL "rtt")
|
||||||
target_compile_definitions(tinyusb_additions INTERFACE
|
target_compile_definitions(tinyusb_additions INTERFACE
|
||||||
LOGGER_RTT
|
LOGGER_RTT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user