Split Nano firmware into modules

- config.h: all constants and debug defines
- command_parser.h/.cpp: CommandParser class, one method per command
- settings.h/.cpp: EEPROM flip time storage
- main.cpp: setup/loop and the periodic full redraw only
- Full redraw now checks frameEnded() after the serial buffer is drained
- Drop the SPI/Adafruit_I2CDevice include workaround (not needed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-13 00:19:25 +02:00
1 parent 75f677a2eb
commit 80f3f78152
8 files changed
+429 -279

No files matched your search

+3 -1
View File
@@ -42,6 +42,8 @@ See README.md for the overview.
## Nano serial parser (`src/nano/main.cpp`)
- Files: `main.cpp` (setup/loop, refresh), `config.h` (all constants and debug
defines), `command_parser.*` (protocol, one method per command), `settings.*` (EEPROM).
- Line based and non-blocking: bytes are collected into a 64-character buffer and a
command runs when `\n` arrives. Bitmap (`B`) pixel data is the exception. It is drawn
while it arrives, so it can be longer than the buffer. Keep `loop()` free of busy-waits.
@@ -53,7 +55,7 @@ See README.md for the overview.
- The Nano only replies `READY` (at boot) and `ERR: ...`. There is no per-frame
acknowledgement. Whether the Nano's TX is wired to the ESP's RX is unconfirmed, so every
wait for a reply needs a timeout.
- To test the parser without hardware, compile `main.cpp` with g++ (Strawberry Perl
- To test the parser without hardware, compile all `src/nano/*.cpp` files with g++ (Strawberry Perl
provides it at `C:\Strawberry\c\bin`) and mock headers for `Arduino.h`, `EEPROM.h` and
`BROSE9323.h`.