2020-04-07 08:42:48 +02:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
|
|
|
# TOP is absolute path to root directory of TinyUSB git repo
|
|
|
|
set(TOP "../../..")
|
|
|
|
get_filename_component(TOP "${TOP}" REALPATH)
|
|
|
|
|
2021-01-22 18:12:10 +01:00
|
|
|
set(PROJECT board_test)
|
|
|
|
|
2021-01-22 08:58:32 +01:00
|
|
|
# Check for -DFAMILY=
|
|
|
|
if(NOT DEFINED FAMILY)
|
|
|
|
message(FATAL_ERROR "Invalid FAMILY specified")
|
|
|
|
endif()
|
2020-04-08 19:06:18 +02:00
|
|
|
|
2021-01-22 08:58:32 +01:00
|
|
|
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
2021-01-22 18:12:10 +01:00
|
|
|
project(${PROJECT})
|
|
|
|
|
|
|
|
if(FAMILY STREQUAL "rp2040")
|
|
|
|
|
|
|
|
pico_sdk_init()
|
|
|
|
|
|
|
|
add_executable(${PROJECT})
|
|
|
|
|
|
|
|
target_sources(${PROJECT} PRIVATE
|
|
|
|
src/main.c
|
|
|
|
"${TOP}/hw/bsp/rp2040/boards/raspberry_pi_pico/board_raspberry_pi_pico.c"
|
|
|
|
)
|
2020-04-07 08:42:48 +02:00
|
|
|
|
2021-01-22 18:12:10 +01:00
|
|
|
target_include_directories(${PROJECT} PRIVATE
|
|
|
|
"src/"
|
|
|
|
"${TOP}/hw"
|
|
|
|
"${TOP}/src"
|
|
|
|
)
|
2021-01-22 08:58:32 +01:00
|
|
|
|
2021-01-22 18:12:10 +01:00
|
|
|
target_compile_definitions(${PROJECT} PUBLIC
|
|
|
|
CFG_TUSB_MCU=OPT_MCU_RP2040
|
|
|
|
CFG_TUSB_OS=OPT_OS_PICO
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT} pico_stdlib)
|
|
|
|
|
|
|
|
pico_add_extra_outputs(${PROJECT})
|
|
|
|
|
|
|
|
endif()
|