mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
The order radio jobs go out in was spread across callers, file statics and the radio task: each remote tracked its last back job so a stop could decide whether it may jump the queue, and the task kept a separate count of the back jobs it had taken. RadioScheduler now owns the waiting jobs, their tickets, the stop-goes-first rule, delayed jobs, flush and suspend, and the outcome of every job. It is plain C++, with the time passed in and the caller locking, so all of it is covered by native tests. Transceiver keeps the FreeRTOS task, the locks and the CC1101. sendCommandAfter returns the job's ticket instead of leaving it in lastTxSeq. Two stops for the same remote now go out in the order they were sent; queued to the front they used to come out reversed, putting the rolling codes out of order. Adds GLOSSARY.md for the radio terms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
112 lines
3.2 KiB
INI
112 lines
3.2 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 = esp32devdbg
|
|
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]
|
|
platform = espressif32 @ 6.13.0
|
|
framework = arduino
|
|
; Unit tests only run on the PC: pio test -e native
|
|
test_ignore = *
|
|
lib_deps =
|
|
bblanchon/ArduinoJson@^7.2.2
|
|
lsatan/SmartRC-CC1101-Driver-Lib@^2.5.7
|
|
knolleary/PubSubClient@^2.8
|
|
esp32async/ESPAsyncWebServer@^3.10.3
|
|
esp32async/AsyncTCP@^3.4.10
|
|
extra_scripts =
|
|
pre:app_version.py
|
|
pre:minify.py
|
|
post:archive_elf.py
|
|
board_build.filesystem = littlefs
|
|
build_flags =
|
|
-DCORE_DEBUG_LEVEL=3
|
|
-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
|
|
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}
|
|
|
|
[env:esp32devdbg]
|
|
extends = esp32
|
|
board = esp32dev
|
|
build_type = debug
|
|
board_build.partitions = esp32_3MB.csv
|
|
build_flags = ${dualcore.build_flags}
|
|
|
|
[env:esp32c3]
|
|
extends = esp32
|
|
board = esp32-c3-devkitm-1
|
|
board_build.partitions = esp32_3MB.csv
|
|
|
|
[env:esp32s3]
|
|
extends = esp32
|
|
board = esp32-s3-devkitc-1
|
|
build_flags = ${dualcore.build_flags}
|
|
|
|
[env:esp32c6]
|
|
extends = esp32
|
|
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
|
|
board = seeed_xiao_esp32c6
|
|
build_type = debug
|
|
board_build.partitions = esp32_huge_app.csv
|
|
build_flags =
|
|
${esp32.build_flags}
|
|
-DCONFIG_FREERTOS_HZ=1000
|
|
-include "driver/gpio.h"
|
|
lib_deps =
|
|
; Low-Level libs, frameowrks and drivers
|
|
ESP32Async/AsyncTCP
|
|
https://github.com/Viproz/SmartRC-CC1101-Driver-Lib.git
|
|
; Commmunication Protocol
|
|
links2004/WebSockets
|
|
https://github.com/hmueller01/pubsubclient3.git
|
|
; Data-Parsing
|
|
bblanchon/ArduinoJson
|
|
; High-level wrappers/servers
|
|
ESP32Async/ESPAsyncWebServer
|
|
|
|
; 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> +<SomfyFrame.cpp> +<JsonFormatter.cpp> +<ShadeMotion.cpp> +<TxBuffer.cpp> +<RadioScheduler.cpp>
|
|
build_flags =
|
|
-std=gnu++17
|
|
-Isrc
|
|
-Itest/stubs
|
|
-D_POSIX_THREAD_SAFE_FUNCTIONS
|