Power-cycle-friendly Nano boot and ESP relay handling

Nano / driver:
- No full on/off flip at boot; the first display() after boot is a forced
  full redraw instead, since the physical dot state is unknown
- Send READY when booted

ESP32:
- relayOn() only switches and waits when the relay was off, and waits for
  the Nano's READY (3 s timeout) instead of a fixed 3 s on every frame
- relayOff() ends Serial and releases the TX pin so the idle-high line no
  longer back-powers the Nano through its RX pin
- No display commands are sent while the relay is off
- Switching the relay on cancels a pending power-off countdown

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-13 00:12:28 +02:00
1 parent f7ffcf4ab3
commit 6e4d5e152b
8 files changed
+158 -68

No files matched your search

+6 -4
View File
@@ -65,10 +65,6 @@ void BROSE9323::begin(void)
pinMode(ENABLE, OUTPUT);
_setData(1);
_setData(0);
fillScreen(1);
display();
fillScreen(0);
display();
}
#endif
@@ -80,6 +76,11 @@ void BROSE9323::display(bool force)
#else
if (_direct_mode)
return;
if (_force_next)
{
force = true;
_force_next = false;
}
for (uint8_t x = 0; x < width(); x++)
{
_selectPanel(x / _panel_width);
@@ -188,6 +189,7 @@ void BROSE9323::fillScreen(uint16_t color)
}
#if !defined(__AVR_ATmega168P__) && !defined(__AVR_ATmega168PB__) && !defined(__AVR_ATmega168__)
memset(_old_buffer, color ? 0xFF : 0x00, _buffer_size);
_force_next = false;
#endif
}
#endif
+2
View File
@@ -24,6 +24,8 @@ private:
uint8_t _active_col = 255;
uint8_t _active_row = 255;
bool _active_data;
// After boot the physical dot state is unknown, so the first display() redraws everything
bool _force_next = true;
#ifndef FLIPDOT_PLCC_ADAPTER
const uint8_t ENABLE = 7,