@@ -86,19 +86,18 @@ function(family_configure_target TARGET)
86
86
# TOP is path to root directory
87
87
set (TOP "${CMAKE_CURRENT_FUNCTION_LIST_DIR} /../../.." )
88
88
89
- #---------- BSP_TARGET ----------
90
- # BSP_TARGET is built for each example since it depends on example's tusb_config.h
91
- set (BSP_TARGET "${TARGET} -bsp" )
92
- add_library (${BSP_TARGET} STATIC
93
- # TinyUSB
89
+ #---------- Port Specific ----------
90
+ # These files are built for each example since it depends on example's tusb_config.h
91
+ target_sources (${TARGET} PUBLIC
92
+ # TinyUSB Port
94
93
${TOP} /src/portable/chipidea/ci_hs/dcd_ci_hs.c
95
94
${TOP} /src/portable/chipidea/ci_hs/hcd_ci_hs.c
96
95
${TOP} /src/portable/ehci/ehci.c
97
96
# BSP
98
97
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /family.c
99
98
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /../board.c
100
99
)
101
- target_include_directories (${BSP_TARGET } PUBLIC
100
+ target_include_directories (${TARGET } PUBLIC
102
101
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
103
102
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /../../
104
103
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /boards/${BOARD}
@@ -120,17 +119,16 @@ function(family_configure_target TARGET)
120
119
add_subdirectory (${TOP} /src ${CMAKE_CURRENT_BINARY_DIR} /tinyusb )
121
120
122
121
# Link dependencies
123
- target_link_libraries (${BSP_TARGET} PUBLIC ${BOARD_TARGET} ${TARGET} -tinyusb )
124
- target_link_libraries (${TARGET} PUBLIC ${BOARD_TARGET} ${BSP_TARGET} ${TARGET} -tinyusb )
122
+ target_link_libraries (${TARGET} PUBLIC ${BOARD_TARGET} ${TARGET} -tinyusb )
125
123
126
124
# Flash Target
127
125
add_custom_target (${TARGET} -pyocd
128
126
COMMAND pyocd flash -t ${PYOCD_TARGET} $< TARGET_FILE:${TARGET} >
129
127
)
130
128
131
129
# group target
132
- set_target_properties (${BSP_TARGET} ${ TARGET}-tinyusb ${TARGET} -tinyusb_config ${TARGET} -pyocd
133
- PROPERTIES FOLDER ${TARGET}
130
+ set_target_properties (${TARGET} -tinyusb ${TARGET} -tinyusb_config
131
+ PROPERTIES FOLDER ${TARGET} _sub
134
132
)
135
133
endfunction ()
136
134
@@ -148,15 +146,10 @@ function(family_add_freertos TARGET)
148
146
target_compile_definitions (${TARGET} -tinyusb_config INTERFACE
149
147
CFG_TUSB_OS=OPT_OS_FREERTOS
150
148
)
151
- # tinyusb need to be linked with freeRTOS kernel
149
+ # link tinyusb with freeRTOS kernel
152
150
target_link_libraries (${TARGET} -tinyusb PUBLIC
153
151
freertos_kernel
154
152
)
155
-
156
- target_link_libraries (${TARGET} -tinyusb PUBLIC
157
- freertos_kernel
158
- )
159
-
160
153
target_link_libraries (${TARGET} PUBLIC
161
154
freertos_kernel
162
155
)
0 commit comments