-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
70 lines (50 loc) · 2.47 KB
/
Copy pathCMakeLists.txt
File metadata and controls
70 lines (50 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
cmake_minimum_required(VERSION 3.17)
# Pull in SDK (must be before project)
if(NOT(DEFINED ENV{PICO_SDK_PATH}))
set(PICO_SDK_PATH ${CMAKE_CURRENT_LIST_DIR}/pico-sdk)
endif ()
include(pico_sdk_import.cmake)
#include(${PICO_SDK_PATH}/tools/CMakeList.txt)
project(467CustomController C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
#pico_sdk_init()
set(FAMILY rp2040)
set(BOARD pico_sdk)
set(TINYUSB_FAMILY_PROJECT_NAME_PREFIX "tinyusb_dev_")
include(${PICO_SDK_PATH}/lib/tinyusb/hw/bsp/family_support.cmake)
include(${PICO_SDK_PATH}/lib/tinyusb/hw/bsp/${FAMILY}/family.cmake)
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
project(${PROJECT})
# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
add_executable(${PROJECT} src/main.c src/usb_descriptors.c src/data_protocol.h src/led.c src/led.h src/config.h src/encoder.c src/encoder.h src/input.c src/input.h)
pico_generate_pio_header(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/src/ws2812.pio OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/src/generated)
pico_generate_pio_header(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/src/pio_rotary_encoder.pio OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/src/generated)
# Example source
target_sources(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
${CMAKE_CURRENT_SOURCE_DIR}/src/led.c
${CMAKE_CURRENT_SOURCE_DIR}/src/led.h
${CMAKE_CURRENT_SOURCE_DIR}/src/encoder.c
${CMAKE_CURRENT_SOURCE_DIR}/src/encoder.h
)
# Example include
target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/generated
)
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
# generate the header file into the source tree as it is included in the RP2040 datasheet
target_link_libraries(${PROJECT} PUBLIC pico_stdlib hardware_pio hardware_dma hardware_irq)
#add_executable(467CustomController src/main.c src/usb_descriptors.c src/usb_descriptors.h src/tusb_config.h)
#
## Pull in our pico_stdlib which pulls in commonly used features
#target_link_libraries(467CustomController pico_stdlib)
#
## create map/bin/hex file etc.
#pico_add_extra_outputs(467CustomController)