Skip to content

Commit a61d0f0

Browse files
committed
more rp2040 family clean up
1 parent 8aa28e6 commit a61d0f0

File tree

1 file changed

+18
-24
lines changed

1 file changed

+18
-24
lines changed

hw/bsp/rp2040/family.cmake

+18-24
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ set(FAMILY_MCUS RP2040)
1414

1515
include(${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake)
1616

17-
# TOP is absolute path to root directory of TinyUSB git repo
18-
#set(TOP "${CMAKE_CURRENT_LIST_DIR}/../../..")
19-
#get_filename_component(TOP "${TOP}" REALPATH)
20-
2117
if (NOT PICO_TINYUSB_PATH)
2218
set(PICO_TINYUSB_PATH ${TOP})
2319
endif()
@@ -38,29 +34,30 @@ target_sources(tinyusb_common_base INTERFACE
3834

3935
target_include_directories(tinyusb_common_base INTERFACE
4036
${TOP}/src
41-
${TOP}/src/common
42-
${TOP}/hw
43-
)
44-
45-
target_link_libraries(tinyusb_common_base INTERFACE
46-
hardware_structs
47-
hardware_irq
48-
hardware_resets
49-
pico_sync
5037
)
5138

52-
set(TINYUSB_DEBUG_LEVEL 0)
53-
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
39+
if(DEFINED LOG)
40+
set(TINYUSB_DEBUG_LEVEL ${LOG})
41+
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
5442
message("Compiling TinyUSB with CFG_TUSB_DEBUG=1")
5543
set(TINYUSB_DEBUG_LEVEL 1)
44+
else ()
45+
set(TINYUSB_DEBUG_LEVEL 0)
5646
endif()
5747

5848
target_compile_definitions(tinyusb_common_base INTERFACE
5949
CFG_TUSB_MCU=OPT_MCU_RP2040
6050
CFG_TUSB_OS=${TINYUSB_OPT_OS}
61-
#CFG_TUSB_DEBUG=${TINYUSB_DEBUG_LEVEL}
51+
CFG_TUSB_DEBUG=${TINYUSB_DEBUG_LEVEL}
6252
)
6353

54+
target_link_libraries(tinyusb_common_base INTERFACE
55+
hardware_structs
56+
hardware_irq
57+
hardware_resets
58+
pico_sync
59+
)
60+
6461
#------------------------------------
6562
# Base config for device mode; wrapped by SDK's tinyusb_device
6663
#------------------------------------
@@ -109,10 +106,11 @@ target_compile_definitions(tinyusb_host_base INTERFACE
109106
#------------------------------------
110107
add_library(tinyusb_bsp INTERFACE)
111108
target_sources(tinyusb_bsp INTERFACE
112-
${TOP}/hw/bsp/rp2040/family.c
113-
)
114-
# target_include_directories(tinyusb_bsp INTERFACE
115-
# ${TOP}/hw/bsp/rp2040)
109+
${TOP}/hw/bsp/rp2040/family.c
110+
)
111+
target_include_directories(tinyusb_bsp INTERFACE
112+
${TOP}/hw
113+
)
116114

117115
# tinyusb_additions will hold our extra settings for examples
118116
add_library(tinyusb_additions INTERFACE)
@@ -122,10 +120,6 @@ target_compile_definitions(tinyusb_additions INTERFACE
122120
PICO_RP2040_USB_DEVICE_UFRAME_FIX=1
123121
)
124122

125-
if(DEFINED LOG)
126-
target_compile_definitions(tinyusb_additions INTERFACE CFG_TUSB_DEBUG=${LOG})
127-
endif()
128-
129123
if(LOGGER STREQUAL "RTT" OR LOGGER STREQUAL "rtt")
130124
target_compile_definitions(tinyusb_additions INTERFACE
131125
LOGGER_RTT

0 commit comments

Comments
 (0)