2023-04-10 11:51:45 +02:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
|
2024-11-03 21:30:47 +01:00
|
|
|
if((NOT DEFINED ENV{PICO_SDK_PATH}) AND (NOT PICO_SDK_PATH))
|
|
|
|
set(PICO_SDK_FETCH_FROM_GIT_TAG "2.0.0")
|
|
|
|
set(PICO_SDK_FETCH_FROM_GIT ON)
|
|
|
|
endif()
|
2023-04-10 11:51:45 +02:00
|
|
|
|
2024-11-03 21:30:47 +01:00
|
|
|
if((NOT DEFINED ENV{PICO_BOARD}) AND (NOT PICO_BOARD))
|
|
|
|
set(PICO_BOARD "seeed_xiao_rp2040")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(pico_sdk_import.cmake)
|
|
|
|
|
|
|
|
project(DonCon2040 VERSION 0.39.0)
|
2023-04-10 11:51:45 +02:00
|
|
|
|
|
|
|
pico_sdk_init()
|
|
|
|
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
|
|
|
add_compile_options(-Wall -Wextra -Werror)
|
|
|
|
|
|
|
|
add_subdirectory(libs)
|
|
|
|
|
2024-11-03 21:30:47 +01:00
|
|
|
file(
|
|
|
|
GLOB
|
|
|
|
${PROJECT_NAME}_SOURCES
|
|
|
|
src/*.cpp
|
|
|
|
src/usb/*.c
|
|
|
|
src/usb/device/*.c
|
|
|
|
src/usb/device/hid/*.c
|
|
|
|
src/usb/device/vendor/*.c
|
|
|
|
src/utils/*.cpp
|
|
|
|
src/peripherals/*.cpp)
|
2023-04-10 11:51:45 +02:00
|
|
|
|
|
|
|
add_executable(${PROJECT_NAME} ${${PROJECT_NAME}_SOURCES})
|
|
|
|
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
|
|
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
|
|
|
|
|
2023-04-22 17:44:38 +02:00
|
|
|
target_link_libraries(
|
2023-05-20 20:17:26 +02:00
|
|
|
${PROJECT_NAME}
|
|
|
|
PUBLIC tinyusb_device
|
|
|
|
tinyusb_board
|
|
|
|
pico_stdlib
|
|
|
|
hardware_adc
|
2023-08-09 22:29:27 +02:00
|
|
|
hardware_i2c
|
|
|
|
hardware_spi
|
2023-05-20 20:17:26 +02:00
|
|
|
pico_multicore
|
|
|
|
pio_ws2812
|
2023-05-22 00:08:23 +02:00
|
|
|
pico_ssd1306
|
2023-08-01 22:32:29 +02:00
|
|
|
mcp23017
|
|
|
|
mcp3204)
|
2023-04-10 11:51:45 +02:00
|
|
|
|
|
|
|
pico_enable_stdio_usb(${PROJECT_NAME} 1)
|
|
|
|
pico_enable_stdio_uart(${PROJECT_NAME} 0)
|
|
|
|
|
|
|
|
# create map/bin/hex/uf2 file in addition to ELF.
|
|
|
|
pico_add_extra_outputs(${PROJECT_NAME})
|