2023-01-03 00:24:27 +08:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
include(pico-sdk/pico_sdk_init.cmake)
|
|
|
|
|
2023-01-21 09:36:25 +08:00
|
|
|
project(firmware)
|
2023-01-03 00:24:27 +08:00
|
|
|
pico_sdk_init()
|
|
|
|
|
2023-01-30 06:39:01 +08:00
|
|
|
file(GLOB TLS_SOURCES "mbedtls/library/*.c")
|
2023-01-21 09:36:25 +08:00
|
|
|
add_executable(firmware
|
|
|
|
main.c
|
|
|
|
../../../mongoose.c
|
|
|
|
../../device-dashboard/net.c
|
2023-01-30 06:39:01 +08:00
|
|
|
../../device-dashboard/packed_fs.c
|
|
|
|
${TLS_SOURCES})
|
|
|
|
|
|
|
|
target_include_directories(firmware PUBLIC . ../../.. mbedtls/include)
|
2023-01-21 09:36:25 +08:00
|
|
|
target_link_libraries(firmware pico_stdlib hardware_spi)
|
|
|
|
pico_add_extra_outputs(firmware)
|
2023-01-03 00:24:27 +08:00
|
|
|
|
|
|
|
# Enable USB output. Comment out in order to use UART
|
2023-01-21 09:36:25 +08:00
|
|
|
pico_enable_stdio_usb(firmware 0)
|
|
|
|
pico_enable_stdio_uart(firmware 1)
|
2023-01-03 00:24:27 +08:00
|
|
|
|
|
|
|
# Mongoose build flags
|
2023-02-08 05:16:42 +08:00
|
|
|
add_definitions(-DMG_ENABLE_TCPIP=1)
|
2023-01-21 09:36:25 +08:00
|
|
|
add_definitions(-DMG_ENABLE_PACKED_FS=1)
|
|
|
|
add_definitions(-DMG_ENABLE_FILE=0)
|
2023-01-30 06:39:01 +08:00
|
|
|
|
|
|
|
add_definitions(-DMG_ENABLE_MBEDTLS=1)
|
|
|
|
add_definitions(-DMBEDTLS_CONFIG_FILE=\"tlsconf.h\")
|
|
|
|
#add_definitions(-DMG_MBEDTLS_DEBUG_LEVEL=1)
|