Restructure into a single PlatformIO project with nano and esp32 targets

- Shared BROSE9323 driver in lib/, ESPSERIAL selected via build_flags
- Nano firmware in src/nano, ESP32 firmware in src/esp32
- Move WiFi/MQTT credentials to gitignored secrets.h (template provided)
- Pin home-assistant-integration to 2.1.0 from the registry
- Add esp32_usb environment for first flash / recovery
- Add READMEs and CLAUDE.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-12 23:55:15 +02:00
commit 0e4d39c47b
18 files changed
+1905

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
# Flipdot display: notes for Claude
A PlatformIO project with two firmware targets for an 84×19 Brose flipdot clock.
See README.md for the overview.
## Layout and build
- `platformio.ini` has the environments `nano`, `esp32` (OTA to 10.1.1.198) and
`esp32_usb` (COM11). The sources are split with `build_src_filter` (`src/nano/`,
`src/esp32/`).
- `lib/BROSE9323/` is the shared driver. Its behaviour depends on build flags set in
`platformio.ini`, not in the header:
- `ESPSERIAL` (ESP32): draw calls become serial commands.
- `FLIPDOT_PLCC_ADAPTER` (Nano, optional): alternative pinout.
- PlatformIO CLI is not on PATH. Run `~/.platformio/penv/Scripts/pio.exe run` (Git Bash)
or `$env:USERPROFILE\.platformio\penv\Scripts\pio.exe run` (PowerShell).
- If an ESP32 build fails with `No module named 'intelhex'`, run
`~/.platformio/penv/Scripts/python.exe -m pip install intelhex`.
- After any change, build both targets: `pio run -e nano -e esp32`.
## Constraints
- **Nano RAM is tight** (ATmega328P, 2 KB). The frame buffers are allocated with
`calloc`. Avoid `String`, large stack buffers and new globals in Nano code. Put constant
data in `PROGMEM`.
- The Nano and the ESP32 share one UART. On the ESP32, `Serial` is the display link, so
**don't print debug output on the ESP32's `Serial`**: the Nano would read it as
commands. The Nano ignores unknown command bytes, but text that starts with
s/S/F/D/P/B/R/T will be run as a command.
- `src/esp32/secrets.h` holds the real credentials and is gitignored. Never commit it.
Add new secrets to `secrets.example.h` as placeholders.
- Hardware is not available here. Builds can be checked, but runtime behaviour can't.
## Known quirks in the serial protocol (Nano `src/nano/main.cpp`)
- `T` waits for more than 6 bytes before parsing, but `T225\n` has only 4 after the `T`.
It completes only when the next command arrives.
- The `T` value is stored with `EEPROM.update` in one byte, so values above 255 µs are
truncated after a reboot.
- `P` (print text) busy-waits for a `\n` and has no timeout.
## Git
- Remote: https://mangavalk.com/mangavalk/Flipdot-display.git, branch `main`.