mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-11-20 15:52:12 +01:00
Configure the integrated radio power, shared SPI selects, RF path and fixed wiring without changing generic boards. Preload output latches for Arduino 3 and publish radio availability only after register and RX checks succeed. Reuse the existing partition table and protect integrated, USB and PSRAM pins across configuration and GPIO output paths. Exercise production setup, RX and queue admission methods in a hardware-boundary host harness, run it in CI and document the opt-in build. Keep restore policy, security corrections and release tooling outside this board-only change.
194 lines
6.4 KiB
INI
194 lines
6.4 KiB
INI
; PlatformIO Project Configuration File
|
|
;
|
|
; Build options: build flags, source filter
|
|
; Upload options: custom upload port, speed and extra flags
|
|
; Library options: dependencies, extra library storages
|
|
; Advanced options: extra scripting
|
|
;
|
|
; Please visit documentation for the other options and examples
|
|
; https://docs.platformio.org/page/projectconf.html
|
|
|
|
[platformio]
|
|
default_envs = esp32s3dbg
|
|
src_dir = src
|
|
|
|
; Shared by every firmware env (they extend it). Kept out of [env] so the
|
|
; native test env doesn't inherit the Arduino framework and ESP32 libraries.
|
|
[esp32]
|
|
; pioarduino: Arduino 3.3.12 on ESP-IDF 5.5. Pinned to a release so an
|
|
; upgrade is its own PR (docs/adr/0003-pioarduino-idf55.md).
|
|
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.312/platform-espressif32.zip
|
|
framework = arduino
|
|
; Unit tests only run on the PC: pio test -e native
|
|
test_ignore = *
|
|
; Exact versions: a new release of a library only gets into the firmware
|
|
; through a PR that bumps it here.
|
|
lib_deps =
|
|
bblanchon/ArduinoJson@7.4.3
|
|
knolleary/PubSubClient@2.8
|
|
esp32async/ESPAsyncWebServer@3.12.1
|
|
esp32async/AsyncTCP@3.5.0
|
|
extra_scripts =
|
|
pre:app_version.py
|
|
pre:minify.py
|
|
post:archive_elf.py
|
|
board_build.filesystem = littlefs
|
|
; Each env adds a CORE_DEBUG_LEVEL: 2 (warnings) for release builds, which
|
|
; only fit the 1.5 MB OTA slot without the info logs, 3 for debug builds.
|
|
; The C5 and C6 release their debug build, which has a 3 MB slot.
|
|
build_flags =
|
|
-DCONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=1
|
|
-DCONFIG_ESP_COREDUMP_DATA_FORMAT_ELF=1
|
|
-DCONFIG_ESP_COREDUMP_CHECKSUM_CRC32=1
|
|
-DCONFIG_ESP_TASK_WDT_PANIC=1
|
|
-DCONFIG_ESP_COREDUMP_DECODE_INFO=1
|
|
; Route log_printfv through src/LogLock.cpp so lines from both cores don't
|
|
; interleave. The core already wraps log_printf for ESP Insights.
|
|
-Wl,--wrap=log_printfv
|
|
; For work on the web UI from a file:// page (baseUrl in index.js): sends
|
|
; the CORS headers and lets the socket take Origin: null, which such a page
|
|
; sends. Never in a release (docs/SECURITY_PLAN.md, CORS).
|
|
; -DWEB_CORS
|
|
monitor_speed = 115200
|
|
monitor_filters =
|
|
time
|
|
esp32_exception_decoder
|
|
log2file
|
|
|
|
; Dual-core targets: keep the async web/socket task on core 0 so the radio
|
|
; task on core 1 (with loop()) never competes with network handling.
|
|
[dualcore]
|
|
build_flags =
|
|
${esp32.build_flags}
|
|
-DCONFIG_ASYNC_TCP_RUNNING_CORE=0
|
|
|
|
[env:esp32dev]
|
|
extends = esp32
|
|
board = esp32dev
|
|
board_build.partitions = esp32_3MB.csv
|
|
build_flags =
|
|
${dualcore.build_flags}
|
|
-DCORE_DEBUG_LEVEL=2
|
|
|
|
[env:esp32s3dbg]
|
|
extends = esp32
|
|
board = esp32-s3-devkitc1-n16r8
|
|
build_type = debug
|
|
; One 3 MB app slot and no OTA: the debug build is never shipped and outgrew
|
|
; the 1.5 MB OTA slot. Release envs keep esp32_3MB.csv. NVS stays at 0x9000
|
|
; but the file system shrinks, so moving a board to this table means: take a
|
|
; backup, flash over USB with -t upload -t uploadfs, then restore the backup.
|
|
board_build.partitions = esp32_huge_app.csv
|
|
; -Og only limits inlining in units over large-unit-insns (10000 by default).
|
|
; Smaller files inline ArduinoJson's helpers into every caller, which costs
|
|
; KBs of flash per file, so treat every file as large.
|
|
build_flags =
|
|
${dualcore.build_flags}
|
|
-DCORE_DEBUG_LEVEL=3
|
|
--param=large-unit-insns=1000
|
|
-DSERIAL_BAUD=921600
|
|
; The info logs hold up the task that logs for ~1ms a line at 921600, ~9ms at
|
|
; 115200. The ROM's boot banner stays at 115200, so it shows as garbage.
|
|
monitor_speed = 921600
|
|
|
|
[env:esp32s3]
|
|
extends = esp32
|
|
board = esp32-s3-devkitc-1
|
|
build_flags =
|
|
${dualcore.build_flags}
|
|
-DCORE_DEBUG_LEVEL=2
|
|
|
|
; Headless LILYGO T-Embed CC1101 Plus with its integrated 433 MHz radio.
|
|
[env:lilygo-t-embed-cc1101-plus]
|
|
extends = esp32
|
|
board = esp32-s3-devkitc1-n16r8
|
|
build_type = release
|
|
board_build.partitions = esp32_3MB.csv
|
|
board_build.flash_mode = qio
|
|
board_build.f_flash = 80000000L
|
|
board_build.arduino.memory_type = qio_opi
|
|
board_build.psram_type = opi
|
|
board_upload.flash_size = 16MB
|
|
build_flags =
|
|
${dualcore.build_flags}
|
|
-DCORE_DEBUG_LEVEL=2
|
|
-DARDUINO_USB_MODE=1
|
|
-DARDUINO_USB_CDC_ON_BOOT=1
|
|
-DESPSOMFY_LILYGO_T_EMBED_CC1101_PLUS
|
|
|
|
[env:esp32c3]
|
|
extends = esp32
|
|
board = esp32-c3-devkitm-1
|
|
board_build.partitions = esp32_3MB.csv
|
|
build_flags =
|
|
${esp32.build_flags}
|
|
-DCORE_DEBUG_LEVEL=2
|
|
|
|
; Released like the C6 below. At level 2 its image left 3.4 KB of the
|
|
; 1.5 MB OTA slot, under CI's 8 KB.
|
|
[env:esp32c5]
|
|
extends = esp32
|
|
board = esp32-c5-devkitc-1
|
|
build_type = debug
|
|
board_build.partitions = esp32_huge_app.csv
|
|
build_flags =
|
|
${esp32.build_flags}
|
|
-DCORE_DEBUG_LEVEL=3
|
|
|
|
; Released as a debug build with one 3 MB app slot, so C6 boards update over
|
|
; USB, not OTA.
|
|
[env:esp32c6]
|
|
extends = esp32
|
|
board = seeed_xiao_esp32c6
|
|
build_type = debug
|
|
board_build.partitions = esp32_huge_app.csv
|
|
build_flags =
|
|
${esp32.build_flags}
|
|
-DCORE_DEBUG_LEVEL=3
|
|
|
|
; ESP32-P4 boards such as Waveshare's ESP32-P4-WIFI6-POE-ETH: WiFi through an
|
|
; ESP32-C6 on SDIO (esp-hosted), Ethernet on the P4's own RMII MAC. The
|
|
; framework's P4 libraries run on chip revision v3.01 or later only, and its
|
|
; esp32p4_es libraries on revisions before v2.0, so each gets its own build.
|
|
; No build runs on v2.x or v3.00.
|
|
[env:esp32p4]
|
|
extends = esp32
|
|
board = esp32-p4_r3
|
|
board_build.partitions = esp32_3MB.csv
|
|
build_flags =
|
|
${dualcore.build_flags}
|
|
-DCORE_DEBUG_LEVEL=2
|
|
|
|
[env:esp32p4es]
|
|
extends = esp32
|
|
board = esp32-p4
|
|
board_build.partitions = esp32_3MB.csv
|
|
build_flags =
|
|
${dualcore.build_flags}
|
|
-DCORE_DEBUG_LEVEL=2
|
|
|
|
; Host-side unit tests: pio test -e native (needs gcc/g++ on PATH).
|
|
; Only the sources the tests cover are built; test/stubs stands in for Arduino.h.
|
|
[env:native]
|
|
platform = native
|
|
test_framework = unity
|
|
test_build_src = yes
|
|
build_src_filter = -<*> +<Utils.cpp> +<ConfigRecords.cpp> +<MqttDisco.cpp> +<SomfyFrame.cpp> +<JsonFormatter.cpp> +<ShadeMotion.cpp> +<ShadeSensors.cpp> +<ShadeBehaviour.cpp> +<PulseDecoder.cpp> +<TxBuffer.cpp> +<RadioScheduler.cpp> +<ShadeRequests.cpp> +<entryPoints/MqttCommands.cpp> +<ItemSnapshot.cpp> +<ModelEditor.cpp> +<ShadeChanges.cpp> +<ProtoSchema.cpp> +<ProtoFrame.cpp> +<ProtoSync.cpp> +<ProtoParse.cpp> +<ProtoSlots.cpp> +<ProtoOps.cpp> +<ProtoEdits.cpp> +<ProtoSettings.cpp> +<ProtoAssembly.cpp>
|
|
lib_deps =
|
|
bblanchon/ArduinoJson@7.4.3
|
|
build_flags =
|
|
-std=gnu++17
|
|
-Isrc
|
|
-Itest/stubs
|
|
-D_POSIX_THREAD_SAFE_FUNCTIONS
|
|
|
|
; The native tests with gcov counters, for the coverage report:
|
|
; pio test -e coverage && gcovr
|
|
; gcovr.cfg sets what the report covers and where it goes.
|
|
[env:coverage]
|
|
extends = env:native
|
|
build_flags =
|
|
${env:native.build_flags}
|
|
--coverage
|
|
-O0
|
|
-lgcov
|