Refresh effect per page

Pages choose their own refresh effect (or the Hardware setting), used when
the page appears and for its own changes. Schedule blocks that switch
instantly and rules still switch instantly. The ESP32 sends page effects
to the Nano with a new no-save flag (E ...,2), so page switches don't wear
the Nano's EEPROM. Page format 7 (version 6 pages are converted).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-17 16:57:31 +02:00
1 parent a6b946e17c
commit a904615c51
29 files changed
+152 -17

No files matched your search

+17
View File
@@ -18,6 +18,7 @@ uint32_t FlipdotFrames::dynamicPage(const LocalTime &time, uint32_t now, bool re
bool moving = wait != 0;
// The Nano has no acknowledgement: the next frame waits until it has received this one
// and flipped its dots, or the next frame overflows its serial buffer
_useEffect(_page_effect, redraw);
uint32_t busy = _show(bitmap, !redraw, moving || _instant_next);
_instant_next = false;
return moving && wait < busy ? busy : wait;
@@ -26,6 +27,19 @@ uint32_t FlipdotFrames::dynamicPage(const LocalTime &time, uint32_t now, bool re
void FlipdotFrames::setDrive(uint16_t flip_time, const DriveSettings &drive)
{
_dot_us = (uint32_t)drive.pulses * (flip_time + drive.flip_gap);
_drive = drive;
_nano_effect = EFFECT_UNKNOWN;
}
void FlipdotFrames::_useEffect(uint8_t effect, bool full)
{
if (effect == PAGE_EFFECT_DEFAULT || effect >= DRIVE_EFFECT_COUNT)
effect = _drive.effect;
if (effect == _nano_effect && !full)
return;
uint8_t flags = EFFECT_FLAG_NO_SAVE | (_drive.effect_small_only ? EFFECT_FLAG_SMALL_ONLY : 0);
_display.setEffect(effect, _drive.effect_time, flags);
_nano_effect = effect;
}
// Sends the bitmap; returns about how long the Nano takes to receive and show it in ms
@@ -45,12 +59,14 @@ void FlipdotFrames::noWifi(int hour, int minute)
{
char time[6];
snprintf(time, sizeof(time), "%02d:%02d", hour, minute);
_useEffect(PAGE_EFFECT_DEFAULT, false);
drawTextLines(_display, "No WiFi", time);
_display.display();
}
void FlipdotFrames::page()
{
_useEffect(_page_effect, true);
_show(_page, false, _instant_next);
_instant_next = false;
}
@@ -90,5 +106,6 @@ void FlipdotFrames::setOffBitmap(const uint8_t *bitmap)
void FlipdotFrames::_drawFullScreen(const uint8_t *bitmap)
{
_useEffect(PAGE_EFFECT_DEFAULT, true);
_show(bitmap, false, false);
}