Bring the five-panel hex portal online with a browser 3D/schematic preview, Pi SPI backends, and renamed multi-panel Pico UDP firmware. Co-authored-by: Cursor <cursoragent@cursor.com>
75 lines
1.6 KiB
CMake
75 lines
1.6 KiB
CMake
cmake_minimum_required(VERSION 3.13)
|
|
|
|
set(PICO_BOARD pico CACHE STRING "Board type")
|
|
|
|
include(pico_sdk_import.cmake)
|
|
|
|
project(portal_panel C CXX ASM)
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
pico_sdk_init()
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
iolibrary
|
|
GIT_REPOSITORY https://github.com/Wiznet/ioLibrary_Driver.git
|
|
GIT_TAG master
|
|
)
|
|
FetchContent_MakeAvailable(iolibrary)
|
|
|
|
set(IOLIB_DIR ${iolibrary_SOURCE_DIR})
|
|
|
|
add_executable(panel
|
|
main.c
|
|
wizchip_spi.c
|
|
timer.c
|
|
ws2812_led.cpp
|
|
WS2812.cpp
|
|
${IOLIB_DIR}/Ethernet/socket.c
|
|
${IOLIB_DIR}/Ethernet/wizchip_conf.c
|
|
${IOLIB_DIR}/Ethernet/W5500/w5500.c
|
|
${IOLIB_DIR}/Internet/DHCP/dhcp.c
|
|
)
|
|
|
|
pico_generate_pio_header(panel ${CMAKE_CURRENT_LIST_DIR}/WS2812.pio)
|
|
|
|
target_include_directories(panel PRIVATE
|
|
${CMAKE_CURRENT_LIST_DIR}
|
|
${IOLIB_DIR}/Ethernet
|
|
${IOLIB_DIR}/Internet/DHCP
|
|
)
|
|
|
|
target_compile_definitions(panel PRIVATE
|
|
_WIZCHIP_=W5500
|
|
)
|
|
|
|
if (DEFINED PANEL_ID_BUILD)
|
|
target_compile_definitions(panel PRIVATE PANEL_ID=${PANEL_ID_BUILD})
|
|
endif ()
|
|
|
|
if (DEFINED WS2812_PIN_BUILD)
|
|
target_compile_definitions(panel PRIVATE PIN_WS2812=${WS2812_PIN_BUILD})
|
|
endif ()
|
|
|
|
if (DEFINED WS2812_PIN1_BUILD)
|
|
target_compile_definitions(panel PRIVATE PIN_WS2812_1=${WS2812_PIN1_BUILD})
|
|
endif ()
|
|
|
|
option(PORTAL_USE_DHCP "Use DHCP for W5500" OFF)
|
|
if (PORTAL_USE_DHCP)
|
|
target_compile_definitions(panel PRIVATE USE_DHCP=1)
|
|
else ()
|
|
target_compile_definitions(panel PRIVATE USE_DHCP=0)
|
|
endif ()
|
|
|
|
target_link_libraries(panel
|
|
pico_stdlib
|
|
hardware_spi
|
|
hardware_pio
|
|
)
|
|
|
|
pico_enable_stdio_usb(panel 1)
|
|
pico_enable_stdio_uart(panel 0)
|
|
|
|
pico_add_extra_outputs(panel)
|