2026-04-02 22:15:10 +09:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
|
|
|
|
|
|
set(PICO_BOARD pico2)
|
|
|
|
|
|
|
|
|
|
include(pico_sdk_import.cmake)
|
|
|
|
|
|
|
|
|
|
project(picomap C CXX ASM)
|
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
2026-04-03 16:59:11 +09:00
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
2026-04-02 22:15:10 +09:00
|
|
|
pico_sdk_init()
|
|
|
|
|
|
2026-04-05 21:48:47 +09:00
|
|
|
set(LIB_SOURCES
|
2026-04-11 08:15:41 +09:00
|
|
|
lib/arp.cpp
|
2026-04-06 17:36:41 +09:00
|
|
|
lib/dispatch.cpp
|
2026-04-06 17:24:34 +09:00
|
|
|
lib/handlers.cpp
|
2026-04-11 08:15:41 +09:00
|
|
|
lib/icmp.cpp
|
2026-04-11 09:04:55 +09:00
|
|
|
lib/igmp.cpp
|
2026-04-11 08:15:41 +09:00
|
|
|
lib/ipv4.cpp
|
2026-04-05 21:48:47 +09:00
|
|
|
lib/net.cpp
|
|
|
|
|
lib/tusb_config.cpp
|
2026-04-04 16:22:37 +09:00
|
|
|
w6300/w6300.cpp
|
2026-04-02 22:15:10 +09:00
|
|
|
)
|
|
|
|
|
|
2026-04-06 09:10:50 +09:00
|
|
|
set(LIB_DEPS pico_stdlib tinyusb_device tinyusb_board hardware_pio hardware_spi hardware_dma hardware_clocks)
|
2026-04-03 21:47:48 +09:00
|
|
|
|
2026-04-05 21:48:47 +09:00
|
|
|
add_executable(picomap firmware.cpp ${LIB_SOURCES})
|
|
|
|
|
target_include_directories(picomap PRIVATE include w6300)
|
2026-04-04 20:52:54 +09:00
|
|
|
target_compile_options(picomap PRIVATE -Wall -Wextra -Wno-unused-parameter)
|
2026-04-04 23:08:33 +09:00
|
|
|
pico_generate_pio_header(picomap ${CMAKE_CURRENT_LIST_DIR}/w6300/qspi.pio)
|
2026-04-05 17:03:34 +09:00
|
|
|
pico_enable_stdio_usb(picomap 0)
|
2026-04-02 22:15:10 +09:00
|
|
|
pico_enable_stdio_uart(picomap 0)
|
2026-04-06 17:36:41 +09:00
|
|
|
pico_set_binary_type(picomap copy_to_ram)
|
2026-04-12 09:02:31 +09:00
|
|
|
string(TIMESTAMP BUILD_EPOCH "%s" UTC)
|
|
|
|
|
math(EXPR VERSION_MAJOR "${BUILD_EPOCH} >> 16")
|
|
|
|
|
math(EXPR VERSION_MINOR "${BUILD_EPOCH} & 65535")
|
|
|
|
|
pico_set_binary_version(picomap MAJOR ${VERSION_MAJOR} MINOR ${VERSION_MINOR})
|
|
|
|
|
target_compile_definitions(picomap PRIVATE BUILD_EPOCH=${BUILD_EPOCH})
|
2026-04-02 22:15:10 +09:00
|
|
|
pico_add_extra_outputs(picomap)
|
2026-04-05 21:48:47 +09:00
|
|
|
target_link_libraries(picomap ${LIB_DEPS})
|
|
|
|
|
|
2026-04-11 07:25:16 +09:00
|
|
|
add_executable(picomap_test test.cpp lib/test_handlers.cpp ${LIB_SOURCES})
|
2026-04-05 21:48:47 +09:00
|
|
|
target_include_directories(picomap_test PRIVATE include w6300)
|
|
|
|
|
target_compile_options(picomap_test PRIVATE -Wall -Wextra -Wno-unused-parameter)
|
|
|
|
|
pico_generate_pio_header(picomap_test ${CMAKE_CURRENT_LIST_DIR}/w6300/qspi.pio)
|
|
|
|
|
pico_enable_stdio_usb(picomap_test 0)
|
|
|
|
|
pico_enable_stdio_uart(picomap_test 0)
|
2026-04-06 17:36:41 +09:00
|
|
|
pico_set_binary_type(picomap_test copy_to_ram)
|
2026-04-12 09:02:31 +09:00
|
|
|
pico_set_binary_version(picomap_test MAJOR ${VERSION_MAJOR} MINOR ${VERSION_MINOR})
|
|
|
|
|
target_compile_definitions(picomap_test PRIVATE BUILD_EPOCH=${BUILD_EPOCH})
|
2026-04-05 21:48:47 +09:00
|
|
|
pico_add_extra_outputs(picomap_test)
|
|
|
|
|
target_link_libraries(picomap_test ${LIB_DEPS})
|