Show status messages on the display

- Clock firmware: 'Connecting to WiFi...' and 'Getting the time...' at
  boot, 'Crashed!' in the OTA-only modes, and 'No WiFi' with the time
  when WiFi is down for over a minute (new DisplayController screen)
- Recovery app: shows its reason, the setup WiFi name, or its IP address,
  then powers the display off (flipdots keep the image)
- StatusScreen and drawTextLines shared by both apps
- Driver: ESP begin() no longer draws 'ESP Connected'
- Tests: No WiFi screen, short reason texts (70 total)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-13 01:34:04 +02:00
1 parent 4749f9e596
commit c9e0800e36
19 files changed
+332 -48

No files matched your search

+19 -6
View File
@@ -27,8 +27,17 @@ bool DisplayController::powerEnabled() const
return _power_enabled;
}
void DisplayController::update(uint32_t now, bool time_valid, int hour, int minute)
void DisplayController::update(uint32_t now, bool time_valid, int hour, int minute, bool wifi_connected)
{
if (wifi_connected)
_wifi_lost = false;
else if (!_wifi_lost)
{
_wifi_lost = true;
_wifi_lost_since = now;
}
bool show_no_wifi = _wifi_lost && now - _wifi_lost_since >= NO_WIFI_SHOW_TIME;
// Switched off elsewhere (power timer, Nano flashing): the Nano lost its frame
if (!_power.isOn())
_screen = Screen::Unknown;
@@ -81,7 +90,7 @@ void DisplayController::update(uint32_t now, bool time_valid, int hour, int minu
_power.on();
_screen = Screen::Unknown;
}
_showClock(hour, minute);
_showClock(hour, minute, show_no_wifi);
break;
case ScheduleMode::Standby:
// Flipdots keep their image without power, so the last time stays visible
@@ -91,12 +100,16 @@ void DisplayController::update(uint32_t now, bool time_valid, int hour, int minu
}
}
void DisplayController::_showClock(int hour, int minute)
void DisplayController::_showClock(int hour, int minute, bool no_wifi)
{
if (_screen == Screen::Clock && _shown_hour == hour && _shown_minute == minute)
Screen screen = no_wifi ? Screen::NoWifi : Screen::Clock;
if (_screen == screen && _shown_hour == hour && _shown_minute == minute)
return;
_frames.clock(hour, minute);
_screen = Screen::Clock;
if (no_wifi)
_frames.noWifi(hour, minute);
else
_frames.clock(hour, minute);
_screen = screen;
_shown_hour = hour;
_shown_minute = minute;
}