Line-based JSON protocol over the ESP32-S3 native USB OTG port, providing deterministic sub-millisecond attenuator control without WiFi interference. Runs alongside the existing REST API. Commands: identify, status, config, set, sweep, sweep_stop Protocol: usb-serial-json-v1 (one JSON object per \n-terminated line) Also addresses pre-existing reliability issues found during review: - Thread safety: FreeRTOS mutex in Attenuator class (web server callbacks run on async_tcp task, not loop()) - NVS flash wear: skip persist during sweep, save on stop - WiFi credentials: moved to gitignored platformio_local.ini - Shared header: sweep.h replaces duplicated extern declarations
30 lines
709 B
INI
30 lines
709 B
INI
[platformio]
|
|
extra_configs = platformio_local*.ini
|
|
|
|
[base]
|
|
build_flags =
|
|
-DCORE_DEBUG_LEVEL=0
|
|
-Os
|
|
-DARDUINO_USB_MODE=1
|
|
-DARDUINO_USB_CDC_ON_BOOT=1
|
|
|
|
[wifi]
|
|
; Override in platformio_local.ini — see platformio_local.ini.example
|
|
build_flags =
|
|
|
|
[env:esp32-s3-devkitc-1]
|
|
platform = espressif32
|
|
board = esp32-s3-devkitc-1
|
|
framework = arduino
|
|
board_build.arduino.memory_type = qio_opi ; Use octal PSRAM
|
|
lib_deps =
|
|
mathieucarbou/ESPAsyncWebServer @ ^3.6.0
|
|
bblanchon/ArduinoJson @ ^7.3.0
|
|
adafruit/Adafruit SSD1306 @ ^2.5.13
|
|
adafruit/Adafruit GFX Library @ ^1.11.11
|
|
monitor_speed = 115200
|
|
board_build.filesystem = littlefs
|
|
build_flags =
|
|
${base.build_flags}
|
|
${wifi.build_flags}
|