feat(l1): messages kept on flash across a power-off, and "Powered off" on e-ink

Settings > Messages > Keep messages (Off, 500, 1000, 2500 in all; off by
default; HIST_FLASH, ui-core/HistoryLog.h). Two append-only logs on the QSPI
flash, channels and DMs, restored into the RAM rings at the start. A batch is
written a minute after the first unsaved change and at shutdown, as the L1's
power switch gives no warning. Each segment has a directory of its own: a
LittleFS 1.x commit erases one of a directory's two fixed blocks every time.

E-ink panels keep their last frame, so a shutdown now leaves "Powered off" on
it and puts the controller into deep sleep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-10-30 09:46:43 +01:00
co-authored by Claude Opus 5.5
parent 751cbc1e79
commit bf7b262645
17 changed files with 407 additions and 13 deletions
+13
View File
@@ -76,6 +76,19 @@ void GxEPDDisplay::turnOff() {
_isOn = false;
}
// The last frame the panel will show, then the controller into deep sleep. Only
// a shutdown gets here: a power switch cuts the board with no warning. A full
// refresh, for a clean page, with no radio to serve during its busy wait.
void GxEPDDisplay::showPoweredOff() {
if (!_init) return;
setBusyPumpFn(nullptr, nullptr);
startFrame(GxEPD_WHITE);
setTextSize(1);
drawTextCentered(width() / 2, (height() - getLineHeight()) / 2, "Powered off");
display.display(false);
display.hibernate();
}
void GxEPDDisplay::clear() {
display.fillScreen(GxEPD_WHITE);
forceRedraw();