summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-01-23 00:12:10 +0700
committerhathach <[email protected]>2021-01-23 00:12:10 +0700
commitb8847de8025c0be602c59f0fe28397b6e18a1651 (patch)
tree329f636ef69cd036cb36b2456797293c7bfa54d9 /examples
parentb6e9c42b0217124aaf47e1d65e4eac39c3d3d681 (diff)
get board_test running with pico on both led and button
Diffstat (limited to 'examples')
-rw-r--r--examples/device/board_test/CMakeLists.txt31
1 files changed, 29 insertions, 2 deletions
diff --git a/examples/device/board_test/CMakeLists.txt b/examples/device/board_test/CMakeLists.txt
index ee0d7ef58..62759c49c 100644
--- a/examples/device/board_test/CMakeLists.txt
+++ b/examples/device/board_test/CMakeLists.txt
@@ -4,13 +4,40 @@ cmake_minimum_required(VERSION 3.5)
set(TOP "../../..")
get_filename_component(TOP "${TOP}" REALPATH)
+set(PROJECT board_test)
+
# Check for -DFAMILY=
if(NOT DEFINED FAMILY)
message(FATAL_ERROR "Invalid FAMILY specified")
endif()
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
+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"
+)
-project(board_test)
+target_include_directories(${PROJECT} PRIVATE
+ "src/"
+ "${TOP}/hw"
+ "${TOP}/src"
+)
-include(${TOP}/hw/bsp/${FAMILY}/family_extra.cmake OPTIONAL)
+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()