-
Notifications
You must be signed in to change notification settings - Fork 23
/
CMakeLists.txt
67 lines (53 loc) · 2.43 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
63
64
65
66
67
cmake_minimum_required(VERSION 3.13)
add_compile_definitions(PICO_XOSC_STARTUP_DELAY_MULTIPLIER=128)
# initialize the SDK based on PICO_SDK_PATH
# note: this must happen before project()
include(pico_sdk_import.cmake)
project(my_project LANGUAGES C CXX)
# initialize the Raspberry Pi Pico SDK
pico_sdk_init()
#add_compile_options(-Werror -Wall -Wextra -Wnull-dereference)
#add_compile_options(-Wall)
add_executable(oXs)
#pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_crsf_rx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_crsf_tx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_gps_rx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_gps_tx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_hott_tx_rx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_ibus_tx_rx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_jeti_tx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_mpx_tx_rx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_sbus_tx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_sport_tx_rx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_srxl2_tx_rx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_exbus_tx_rx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_logger_tx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_esc_rx.pio )
pico_generate_pio_header(oXs ${CMAKE_CURRENT_LIST_DIR}/src/uart_frsky_hub_tx.pio)
file(GLOB oXs_SRC CONFIGURE_DEPENDS "src/*.h" "src/*.cpp")
target_sources(oXs PRIVATE ${oXs_SRC} )
target_link_libraries(oXs PRIVATE
pico_stdlib
pico_multicore
hardware_pio
hardware_i2c
hardware_watchdog
hardware_timer
hardware_dma
hardware_irq
hardware_adc
hardware_pwm
hardware_spi
)
#enable printf on usb
pico_enable_stdio_usb(oXs 1)
pico_enable_stdio_uart(oXs 0)
# create map/bin/hex/uf2 file in addition to ELF.
pico_add_extra_outputs(oXs)
add_custom_command(TARGET oXs POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy oXs.uf2 ${CMAKE_SOURCE_DIR}
)
# ARGS -E copy oXs.uf2 ${CMAKE_SOURCE_DIR} it was with -E
# copy the uf2 file to E: drive
add_custom_command(TARGET oXs POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy oXs.uf2 E: )