Fix shifted pictures: non-blocking Nano drawing, frame check, refresh settings

The Nano's periodic full redraw blocked for ~0.8 s. A frame that arrived
meanwhile overflowed its 64-byte serial buffer; lost bytes in a bitmap
shift the rest of the image (picture moved up), and diff frames never
repaired it.

- Nano: all drawing (frames, effects, the dot refresh) runs from update()
  in ~1 ms slices; the refresh pauses while a frame is received or shown
- New commands: C (reply with the image checksum) and I (refresh minutes,
  EEPROM)
- ESP32: NanoMonitor asks for the checksum after frames and sends the whole
  image again on a mismatch, missing answer or Nano restart; counts ERR
  replies. Periodic whole-image resync.
- Settings: "Dot refresh" and "Image resync" intervals (settings v5,
  v4 records are migrated)
- System tab: loop timing, free memory, frame check counts
- test_driver: the real driver against a simulated panel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-16 15:20:26 +02:00
1 parent 58a7cb03c2
commit 090c2bf8ae
45 files changed
+1265 -157

No files matched your search

+10 -2
View File
@@ -12,7 +12,7 @@
; Build one: pio run -e nano
; Upload one: pio run -e nano -t upload
; Serial monitor: pio device monitor -e nano
; Run tests: pio test -e test_nano -e test_esp32
; Run tests: pio test -e test_nano -e test_esp32 -e test_driver
;
; https://docs.platformio.org/page/projectconf.html
@@ -104,7 +104,7 @@ upload_protocol = esptool
upload_port = COM18
; ---------------------------------------------------------------------------
; Unit tests on the PC (pio test -e test_nano -e test_esp32)
; Unit tests on the PC (pio test -e test_nano -e test_esp32 -e test_driver)
; ---------------------------------------------------------------------------
[native]
platform = native
@@ -123,6 +123,14 @@ build_src_filter = +<nano/>
; 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
; 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
; ESP32 logic (test/test_esp32): only the modules without Arduino dependencies
[env:test_esp32]
extends = native