diff options
| author | hathach <[email protected]> | 2021-01-24 00:47:49 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-01-24 00:47:49 +0700 |
| commit | 26522d0ec5825280626f49c7191b7964826bed91 (patch) | |
| tree | 1c84959b7817f6ee0ff9c506d1bd80f18b4f0e0a /examples | |
| parent | 959a94b98d020ee2f6a05e36be56c1618dd6ed78 (diff) | |
rp2040 dual cdc compiled and tested
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/device/cdc_dual_ports/CMakeLists.txt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/device/cdc_dual_ports/CMakeLists.txt b/examples/device/cdc_dual_ports/CMakeLists.txt new file mode 100644 index 000000000..a1dc14b0a --- /dev/null +++ b/examples/device/cdc_dual_ports/CMakeLists.txt @@ -0,0 +1,35 @@ +# use directory name for project id +get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME) + +# TOP is absolute path to root directory of TinyUSB git repo +set(TOP "../../..") +get_filename_component(TOP "${TOP}" REALPATH) + +# Check for -DFAMILY= +if(FAMILY STREQUAL "rp2040") + cmake_minimum_required(VERSION 3.12) + set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk) + include(${PICO_SDK_PATH}/pico_sdk_init.cmake) + project(${PROJECT}) + pico_sdk_init() + add_executable(${PROJECT}) + + include(${TOP}/hw/bsp/${FAMILY}/family.cmake) + + # Example source + target_sources(${PROJECT} PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c + ) + + # Example include + target_include_directories(${PROJECT} PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/src + ) + + target_link_libraries(${PROJECT} pico_stdlib) + pico_add_extra_outputs(${PROJECT}) + +else() + message(FATAL_ERROR "Invalid FAMILY specified") +endif() |
