-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (49 loc) · 1.93 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.5)
include(${CMAKE_CURRENT_SOURCE_DIR}/lib/tinyusb/hw/bsp/family_support.cmake)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
project(${PROJECT})
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
add_executable(${PROJECT})
pico_generate_pio_header(${PROJECT} ${CMAKE_CURRENT_SOURCE_DIR}/src/ws2812.pio)
pico_generate_pio_header(${PROJECT} ${CMAKE_CURRENT_SOURCE_DIR}/src/uart_tx.pio)
pico_generate_pio_header(${PROJECT} ${CMAKE_CURRENT_SOURCE_DIR}/src/uart_rx.pio)
target_sources(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/src/util.c
${CMAKE_CURRENT_SOURCE_DIR}/src/hid.c
${CMAKE_CURRENT_SOURCE_DIR}/src/keysym/consumer.c
${CMAKE_CURRENT_SOURCE_DIR}/src/keysym/system.c
${CMAKE_CURRENT_SOURCE_DIR}/src/split.c
${CMAKE_CURRENT_SOURCE_DIR}/src/ws2812.c
${CMAKE_CURRENT_SOURCE_DIR}/src/led.c
${CMAKE_CURRENT_SOURCE_DIR}/src/keymat.c
${CMAKE_CURRENT_SOURCE_DIR}/src/keymap.c
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_stdio.c
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
)
target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${PICO_SDK_PATH}/src/rp2_common/hardware_gpio/include
${PICO_SDK_PATH}/src/rp2_common/hardware_pio/include
${PICO_SDK_PATH}/src/rp2_common/hardware_timer/include
${PICO_SDK_PATH}/src/rp2_common/hardware_uart/include
${PICO_SDK_PATH}/src/rp2_common/hardware_clocks/include
)
target_link_libraries(${PROJECT} PRIVATE
pico_stdlib
pico_stdio
pico_bootsel_via_double_reset
hardware_pio
hardware_gpio
tinyusb_device
)
target_compile_options(pico_stdio INTERFACE
-Wno-shadow # issue in picosdk/src/rp2_common/hardware_flash/flash.c
-Wno-unused-parameter
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_EXTRA_FLAGS}")
family_configure_target(${PROJECT})
family_add_default_example_warnings(${PROJECT})
suppress_tinyusb_warnings()
#pico_enable_stdio_usb(${PROJECT} 1)
pico_enable_stdio_uart(${PROJECT} 0)