Skip to content

Commit 04c7590

Browse files
committed
simplify cmake target, remove -bsp
1 parent fd50be2 commit 04c7590

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

hw/bsp/imxrt/family.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ void board_init(void)
8686
#if CFG_TUSB_OS == OPT_OS_NONE
8787
// 1ms tick timer
8888
SysTick_Config(SystemCoreClock / 1000);
89+
8990
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
9091
// If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
9192
NVIC_SetPriority(USB_OTG1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);

hw/bsp/imxrt/family.cmake

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,18 @@ function(family_configure_target TARGET)
8686
# TOP is path to root directory
8787
set(TOP "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../..")
8888

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
9493
${TOP}/src/portable/chipidea/ci_hs/dcd_ci_hs.c
9594
${TOP}/src/portable/chipidea/ci_hs/hcd_ci_hs.c
9695
${TOP}/src/portable/ehci/ehci.c
9796
# BSP
9897
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
9998
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
10099
)
101-
target_include_directories(${BSP_TARGET} PUBLIC
100+
target_include_directories(${TARGET} PUBLIC
102101
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
103102
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../
104103
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
@@ -120,17 +119,16 @@ function(family_configure_target TARGET)
120119
add_subdirectory(${TOP}/src ${CMAKE_CURRENT_BINARY_DIR}/tinyusb)
121120

122121
# 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)
125123

126124
# Flash Target
127125
add_custom_target(${TARGET}-pyocd
128126
COMMAND pyocd flash -t ${PYOCD_TARGET} $<TARGET_FILE:${TARGET}>
129127
)
130128

131129
# 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
134132
)
135133
endfunction()
136134

@@ -148,15 +146,10 @@ function(family_add_freertos TARGET)
148146
target_compile_definitions(${TARGET}-tinyusb_config INTERFACE
149147
CFG_TUSB_OS=OPT_OS_FREERTOS
150148
)
151-
# tinyusb need to be linked with freeRTOS kernel
149+
# link tinyusb with freeRTOS kernel
152150
target_link_libraries(${TARGET}-tinyusb PUBLIC
153151
freertos_kernel
154152
)
155-
156-
target_link_libraries(${TARGET}-tinyusb PUBLIC
157-
freertos_kernel
158-
)
159-
160153
target_link_libraries(${TARGET} PUBLIC
161154
freertos_kernel
162155
)

0 commit comments

Comments
 (0)