mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-23 22:43:49 +00:00
simplify cmake target, remove -bsp
This commit is contained in:
parent
fd50be2e62
commit
04c759028a
@ -86,6 +86,7 @@ void board_init(void)
|
|||||||
#if CFG_TUSB_OS == OPT_OS_NONE
|
#if CFG_TUSB_OS == OPT_OS_NONE
|
||||||
// 1ms tick timer
|
// 1ms tick timer
|
||||||
SysTick_Config(SystemCoreClock / 1000);
|
SysTick_Config(SystemCoreClock / 1000);
|
||||||
|
|
||||||
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
|
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
|
||||||
// If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
|
// If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
|
||||||
NVIC_SetPriority(USB_OTG1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
|
NVIC_SetPriority(USB_OTG1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
|
||||||
|
@ -86,11 +86,10 @@ function(family_configure_target TARGET)
|
|||||||
# TOP is path to root directory
|
# TOP is path to root directory
|
||||||
set(TOP "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../..")
|
set(TOP "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../..")
|
||||||
|
|
||||||
#---------- BSP_TARGET ----------
|
#---------- Port Specific ----------
|
||||||
# BSP_TARGET is built for each example since it depends on example's tusb_config.h
|
# These files are built for each example since it depends on example's tusb_config.h
|
||||||
set(BSP_TARGET "${TARGET}-bsp")
|
target_sources(${TARGET} PUBLIC
|
||||||
add_library(${BSP_TARGET} STATIC
|
# TinyUSB Port
|
||||||
# TinyUSB
|
|
||||||
${TOP}/src/portable/chipidea/ci_hs/dcd_ci_hs.c
|
${TOP}/src/portable/chipidea/ci_hs/dcd_ci_hs.c
|
||||||
${TOP}/src/portable/chipidea/ci_hs/hcd_ci_hs.c
|
${TOP}/src/portable/chipidea/ci_hs/hcd_ci_hs.c
|
||||||
${TOP}/src/portable/ehci/ehci.c
|
${TOP}/src/portable/ehci/ehci.c
|
||||||
@ -98,7 +97,7 @@ function(family_configure_target TARGET)
|
|||||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
|
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
|
||||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
|
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
|
||||||
)
|
)
|
||||||
target_include_directories(${BSP_TARGET} PUBLIC
|
target_include_directories(${TARGET} PUBLIC
|
||||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
|
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
|
||||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../
|
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../
|
||||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
|
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
|
||||||
@ -120,8 +119,7 @@ function(family_configure_target TARGET)
|
|||||||
add_subdirectory(${TOP}/src ${CMAKE_CURRENT_BINARY_DIR}/tinyusb)
|
add_subdirectory(${TOP}/src ${CMAKE_CURRENT_BINARY_DIR}/tinyusb)
|
||||||
|
|
||||||
# Link dependencies
|
# Link dependencies
|
||||||
target_link_libraries(${BSP_TARGET} PUBLIC ${BOARD_TARGET} ${TARGET}-tinyusb)
|
target_link_libraries(${TARGET} PUBLIC ${BOARD_TARGET} ${TARGET}-tinyusb)
|
||||||
target_link_libraries(${TARGET} PUBLIC ${BOARD_TARGET} ${BSP_TARGET} ${TARGET}-tinyusb)
|
|
||||||
|
|
||||||
# Flash Target
|
# Flash Target
|
||||||
add_custom_target(${TARGET}-pyocd
|
add_custom_target(${TARGET}-pyocd
|
||||||
@ -129,8 +127,8 @@ function(family_configure_target TARGET)
|
|||||||
)
|
)
|
||||||
|
|
||||||
# group target
|
# group target
|
||||||
set_target_properties(${BSP_TARGET} ${TARGET}-tinyusb ${TARGET}-tinyusb_config ${TARGET}-pyocd
|
set_target_properties(${TARGET}-tinyusb ${TARGET}-tinyusb_config
|
||||||
PROPERTIES FOLDER ${TARGET}
|
PROPERTIES FOLDER ${TARGET}_sub
|
||||||
)
|
)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
@ -148,15 +146,10 @@ function(family_add_freertos TARGET)
|
|||||||
target_compile_definitions(${TARGET}-tinyusb_config INTERFACE
|
target_compile_definitions(${TARGET}-tinyusb_config INTERFACE
|
||||||
CFG_TUSB_OS=OPT_OS_FREERTOS
|
CFG_TUSB_OS=OPT_OS_FREERTOS
|
||||||
)
|
)
|
||||||
# tinyusb need to be linked with freeRTOS kernel
|
# link tinyusb with freeRTOS kernel
|
||||||
target_link_libraries(${TARGET}-tinyusb PUBLIC
|
target_link_libraries(${TARGET}-tinyusb PUBLIC
|
||||||
freertos_kernel
|
freertos_kernel
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(${TARGET}-tinyusb PUBLIC
|
|
||||||
freertos_kernel
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(${TARGET} PUBLIC
|
target_link_libraries(${TARGET} PUBLIC
|
||||||
freertos_kernel
|
freertos_kernel
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user