@@ -14,10 +14,6 @@ set(FAMILY_MCUS RP2040)
14
14
15
15
include (${CMAKE_CURRENT_LIST_DIR} /boards/${BOARD} /board.cmake)
16
16
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
-
21
17
if (NOT PICO_TINYUSB_PATH)
22
18
set (PICO_TINYUSB_PATH ${TOP} )
23
19
endif ()
@@ -38,29 +34,30 @@ target_sources(tinyusb_common_base INTERFACE
38
34
39
35
target_include_directories (tinyusb_common_base INTERFACE
40
36
${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
50
37
)
51
38
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" )
54
42
message ("Compiling TinyUSB with CFG_TUSB_DEBUG=1" )
55
43
set (TINYUSB_DEBUG_LEVEL 1)
44
+ else ()
45
+ set (TINYUSB_DEBUG_LEVEL 0)
56
46
endif ()
57
47
58
48
target_compile_definitions (tinyusb_common_base INTERFACE
59
49
CFG_TUSB_MCU=OPT_MCU_RP2040
60
50
CFG_TUSB_OS=${TINYUSB_OPT_OS}
61
- # CFG_TUSB_DEBUG=${TINYUSB_DEBUG_LEVEL}
51
+ CFG_TUSB_DEBUG=${TINYUSB_DEBUG_LEVEL}
62
52
)
63
53
54
+ target_link_libraries (tinyusb_common_base INTERFACE
55
+ hardware_structs
56
+ hardware_irq
57
+ hardware_resets
58
+ pico_sync
59
+ )
60
+
64
61
#------------------------------------
65
62
# Base config for device mode; wrapped by SDK's tinyusb_device
66
63
#------------------------------------
@@ -109,10 +106,11 @@ target_compile_definitions(tinyusb_host_base INTERFACE
109
106
#------------------------------------
110
107
add_library (tinyusb_bsp INTERFACE )
111
108
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
+ )
116
114
117
115
# tinyusb_additions will hold our extra settings for examples
118
116
add_library (tinyusb_additions INTERFACE )
@@ -122,10 +120,6 @@ target_compile_definitions(tinyusb_additions INTERFACE
122
120
PICO_RP2040_USB_DEVICE_UFRAME_FIX=1
123
121
)
124
122
125
- if (DEFINED LOG )
126
- target_compile_definitions (tinyusb_additions INTERFACE CFG_TUSB_DEBUG=${LOG} )
127
- endif ()
128
-
129
123
if (LOGGER STREQUAL "RTT" OR LOGGER STREQUAL "rtt" )
130
124
target_compile_definitions (tinyusb_additions INTERFACE
131
125
LOGGER_RTT
0 commit comments