2026-10-12 23:55:15 +02:00
|
|
|
; Flipdot display - one PlatformIO project, two firmware targets.
|
|
|
|
|
;
|
2026-10-13 00:35:28 +02:00
|
|
|
; nano Arduino Nano that drives the Brose flipdot panels directly (USB upload)
|
|
|
|
|
; nano_ota Same Nano firmware, flashed over WiFi through the ESP32
|
|
|
|
|
; esp32 ESP32 "brain" (WiFi, NTP clock, Home Assistant) - OTA upload
|
2026-10-13 01:21:04 +02:00
|
|
|
; esp32_usb Same ESP32 firmware, flashed over USB into ota_0
|
|
|
|
|
; recovery ESP32 recovery app (WiFi setup + OTA), USB only, see README.md
|
2026-10-13 00:56:32 +02:00
|
|
|
; test_nano Unit tests for the Nano firmware, run on the PC (needs gcc on PATH)
|
|
|
|
|
; test_esp32 Unit tests for the ESP32 logic, run on the PC
|
2026-10-12 23:55:15 +02:00
|
|
|
;
|
|
|
|
|
; Build all: pio run
|
|
|
|
|
; Build one: pio run -e nano
|
|
|
|
|
; Upload one: pio run -e nano -t upload
|
|
|
|
|
; Serial monitor: pio device monitor -e nano
|
2026-10-16 15:20:26 +02:00
|
|
|
; Run tests: pio test -e test_nano -e test_esp32 -e test_driver
|
2026-10-12 23:55:15 +02:00
|
|
|
;
|
|
|
|
|
; https://docs.platformio.org/page/projectconf.html
|
|
|
|
|
|
|
|
|
|
[platformio]
|
|
|
|
|
default_envs = nano, esp32
|
|
|
|
|
|
|
|
|
|
[env]
|
|
|
|
|
framework = arduino
|
|
|
|
|
monitor_speed = 115200
|
|
|
|
|
lib_deps =
|
|
|
|
|
adafruit/Adafruit GFX Library@^1.10.12
|
2026-10-13 00:56:32 +02:00
|
|
|
; Tests only run in the test_* environments on the PC, never on the boards
|
2026-10-13 00:23:07 +02:00
|
|
|
test_ignore = *
|
2026-10-12 23:55:15 +02:00
|
|
|
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
; Arduino Nano - display driver
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
[env:nano]
|
|
|
|
|
platform = atmelavr
|
|
|
|
|
board = nanoatmega328
|
|
|
|
|
board_build.mcu = atmega328p
|
|
|
|
|
board_build.f_cpu = 16000000L
|
|
|
|
|
build_src_filter = +<nano/>
|
|
|
|
|
; Uncomment when using the PLCC adapter board (different pinout, see lib/BROSE9323/BROSE9323.h)
|
|
|
|
|
; build_flags = -D FLIPDOT_PLCC_ADAPTER
|
|
|
|
|
upload_port = COM10
|
|
|
|
|
monitor_port = COM10
|
|
|
|
|
|
2026-10-13 00:35:28 +02:00
|
|
|
; Same Nano firmware, flashed over WiFi through the ESP32 (see README.md).
|
|
|
|
|
; Needs the Nano TX -> ESP32 GPIO 16 wire. upload_port = ESP32 IP[:port], default port 2323.
|
2026-10-13 00:44:35 +02:00
|
|
|
; --baud: bootloader baud rate. auto tries 57600 (old bootloader), then 115200 (Optiboot).
|
2026-10-13 00:35:28 +02:00
|
|
|
[env:nano_ota]
|
|
|
|
|
extends = env:nano
|
|
|
|
|
upload_protocol = custom
|
|
|
|
|
upload_port = 10.1.1.198
|
2026-10-13 00:44:35 +02:00
|
|
|
upload_flags = --baud=auto
|
|
|
|
|
upload_command = "$PYTHONEXE" "$PROJECT_DIR/tools/nano_net_upload.py" "$SOURCE" $UPLOAD_PORT $UPLOAD_FLAGS
|
2026-10-13 00:35:28 +02:00
|
|
|
|
2026-10-12 23:55:15 +02:00
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
; ESP32 - controller, talks to the Nano over serial
|
|
|
|
|
; ---------------------------------------------------------------------------
|
2026-10-13 01:21:04 +02:00
|
|
|
[esp32_common]
|
2026-10-12 23:55:15 +02:00
|
|
|
platform = espressif32
|
|
|
|
|
board = esp32doit-devkit-v1
|
2026-10-13 01:21:04 +02:00
|
|
|
; factory = recovery app, ota_0 / ota_1 = clock firmware (see partitions.csv)
|
|
|
|
|
board_build.partitions = partitions.csv
|
2026-10-15 00:36:27 +02:00
|
|
|
monitor_port = COM18
|
2026-10-13 01:21:04 +02:00
|
|
|
|
|
|
|
|
[env:esp32]
|
|
|
|
|
extends = esp32_common
|
2026-10-12 23:55:15 +02:00
|
|
|
build_src_filter = +<esp32/>
|
2026-10-13 01:21:04 +02:00
|
|
|
; Size check against the ota slots, not the (smaller) factory partition
|
|
|
|
|
board_build.app_partition_name = ota_0
|
2026-10-12 23:55:15 +02:00
|
|
|
; ESPSERIAL turns the BROSE9323 driver into a serial client: every draw call is
|
|
|
|
|
; sent to the Nano as a text command instead of toggling GPIO pins.
|
2026-10-13 00:56:32 +02:00
|
|
|
build_flags = -D ESPSERIAL -I src/esp32
|
2026-10-12 23:55:15 +02:00
|
|
|
lib_deps =
|
|
|
|
|
${env.lib_deps}
|
|
|
|
|
dawidchyrzynski/home-assistant-integration@^2.1.0
|
2026-10-13 01:52:34 +02:00
|
|
|
bblanchon/ArduinoJson@^7.0.0
|
2026-10-12 23:55:15 +02:00
|
|
|
knolleary/PubSubClient@^2.8.0
|
|
|
|
|
upload_protocol = espota
|
|
|
|
|
upload_port = 10.1.1.198
|
|
|
|
|
|
2026-10-13 01:21:04 +02:00
|
|
|
; USB upload of the clock firmware: written to ota_0, never over the recovery app
|
2026-10-12 23:55:15 +02:00
|
|
|
[env:esp32_usb]
|
|
|
|
|
extends = env:esp32
|
|
|
|
|
upload_protocol = esptool
|
2026-10-15 00:36:27 +02:00
|
|
|
upload_port = COM18
|
2026-10-13 01:21:04 +02:00
|
|
|
board_upload.offset_address = 0x110000
|
|
|
|
|
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
; ESP32 recovery app (src/recovery) in the factory partition: WiFi setup page + OTA.
|
|
|
|
|
; One-time install over USB, see README.md "Recovery app".
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
[env:recovery]
|
|
|
|
|
extends = esp32_common
|
|
|
|
|
build_src_filter =
|
|
|
|
|
+<recovery/>
|
|
|
|
|
+<esp32/logic/boot_policy.cpp>
|
|
|
|
|
+<esp32/system/system_store.cpp>
|
|
|
|
|
+<esp32/system/boot_target.cpp>
|
2026-10-13 01:34:04 +02:00
|
|
|
+<esp32/nano_link/nano_link.cpp>
|
|
|
|
|
+<esp32/display/status_screen.cpp>
|
|
|
|
|
+<esp32/display/text.cpp>
|
|
|
|
|
; ESPSERIAL: status messages are sent to the Nano like in the clock firmware
|
|
|
|
|
build_flags = -D ESPSERIAL -I src/esp32
|
2026-10-13 01:21:04 +02:00
|
|
|
upload_protocol = esptool
|
2026-10-15 00:36:27 +02:00
|
|
|
upload_port = COM18
|
2026-10-13 00:23:07 +02:00
|
|
|
|
|
|
|
|
; ---------------------------------------------------------------------------
|
2026-10-16 15:20:26 +02:00
|
|
|
; Unit tests on the PC (pio test -e test_nano -e test_esp32 -e test_driver)
|
2026-10-13 00:23:07 +02:00
|
|
|
; ---------------------------------------------------------------------------
|
2026-10-13 00:56:32 +02:00
|
|
|
[native]
|
2026-10-13 00:23:07 +02:00
|
|
|
platform = native
|
|
|
|
|
framework =
|
|
|
|
|
lib_deps =
|
|
|
|
|
lib_ignore = BROSE9323
|
|
|
|
|
test_ignore =
|
|
|
|
|
test_build_src = yes
|
2026-10-13 00:56:32 +02:00
|
|
|
|
|
|
|
|
; Nano firmware (test/test_nano). The Arduino core, EEPROM and the display driver are
|
|
|
|
|
; replaced by test/mocks.
|
|
|
|
|
[env:test_nano]
|
|
|
|
|
extends = native
|
|
|
|
|
test_filter = test_nano
|
2026-10-13 00:23:07 +02:00
|
|
|
build_src_filter = +<nano/>
|
2026-10-15 01:29:01 +02:00
|
|
|
; test/mocks first: its BROSE9323.h replaces the driver, dot_sequence.h is the real one
|
|
|
|
|
build_flags = -std=gnu++17 -I test/mocks -I lib/BROSE9323
|
2026-10-13 00:56:32 +02:00
|
|
|
|
2026-10-16 15:20:26 +02:00
|
|
|
; The real display driver (test/test_driver, Nano build) with a simulated panel:
|
|
|
|
|
; test/driver_mocks replaces Arduino and Adafruit GFX, the test includes BROSE9323.cpp
|
|
|
|
|
[env:test_driver]
|
|
|
|
|
extends = native
|
|
|
|
|
test_filter = test_driver
|
|
|
|
|
build_src_filter = -<*>
|
|
|
|
|
build_flags = -std=gnu++17 -I test/driver_mocks -I lib/BROSE9323
|
|
|
|
|
|
2026-10-13 00:56:32 +02:00
|
|
|
; ESP32 logic (test/test_esp32): only the modules without Arduino dependencies
|
|
|
|
|
[env:test_esp32]
|
|
|
|
|
extends = native
|
|
|
|
|
test_filter = test_esp32
|
|
|
|
|
build_src_filter = +<esp32/logic/>
|
|
|
|
|
build_flags = -std=gnu++17 -I src/esp32
|