Send only the changed dots of a frame to the Nano

Frames were sent as F0 plus one s command per yellow dot (thousands of
characters). During scrolling that overran the Nano's serial buffer, and
half-received frames redrew the whole screen. showBitmap() now sends two B
commands over the changed rectangle (dots off, dots on), or one B command for
a full frame, and the pacing counts the characters sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-15 21:14:48 +02:00
1 parent 89001ddbc6
commit 47ef65ee7d
8 files changed
+262 -25

No files matched your search

+4 -3
View File
@@ -49,9 +49,10 @@ const uint32_t POWER_OFF_DELAY = 30000;
// timeout (a read blocks loop() for at most about twice this)
const uint32_t HA_POLL_INTERVAL = 60000;
const uint32_t HA_HTTP_TIMEOUT = 1500;
// Moving dynamic pages (scrolling, seconds): sending a frame to the Nano takes about this
// long (a bitmap at 115200 baud), plus the flip time of the changed dots
const uint32_t FRAME_SEND_TIME = 60;
// Moving dynamic pages (scrolling, seconds): the next frame waits until the Nano received
// this one (characters per ms at NANO_BAUD) and flipped its changed dots, plus a margin
const uint32_t NANO_CHARS_PER_MS = NANO_BAUD / 10000;
const uint32_t FRAME_MARGIN = 20;
// ---------------------------------------------------------------------------
// Flashing the Nano over WiFi (see README.md, pio run -e nano_ota -t upload)