implement dashboard on wake

This commit is contained in:
2026-02-16 02:53:08 -08:00
parent e24d19eb94
commit 3e62c7d481
6 changed files with 202 additions and 96 deletions

View File

@@ -2,7 +2,7 @@
#include <Arduino.h>
// =====================================================================
// Shared enums and structs — NO library dependencies
// Shared enums and structs — NO library dependencies
// =====================================================================
enum class DeviceState : uint8_t {
@@ -18,47 +18,47 @@ enum class ScreenID : uint8_t {
WIFI_FAILED,
ALERT,
STATUS,
OFF // backlight off, nothing to draw
DASHBOARD, // <-- NEW
OFF // backlight off, nothing to draw
};
#define ALERT_HISTORY_SIZE 3
struct AlertRecord {
char message[64] = "";
char timestamp[12] = ""; // "HH:MM:SS"
char timestamp[12] = ""; // "HH:MM:SS"
};
// Everything the display needs to render any screen
struct ScreenState {
ScreenID screen = ScreenID::BOOT_SPLASH;
DeviceState deviceState = DeviceState::SILENT;
bool blinkPhase = false;
ScreenID screen = ScreenID::BOOT_SPLASH;
DeviceState deviceState = DeviceState::SILENT;
bool blinkPhase = false;
// Alert
char alertMessage[64] = "";
char alertMessage[64] = "";
// WiFi
bool wifiConnected = false;
char wifiSSID[33] = "";
int wifiRSSI = 0;
char wifiIP[16] = "";
bool wifiConnected = false;
char wifiSSID[33] = "";
int wifiRSSI = 0;
char wifiIP[16] = "";
// NTP
bool ntpSynced = false;
char timeString[12] = "";
bool ntpSynced = false;
char timeString[12] = "";
// System
uint32_t uptimeMinutes = 0;
uint32_t freeHeapKB = 0;
bool networkOK = false;
uint32_t uptimeMinutes = 0;
uint32_t freeHeapKB = 0;
bool networkOK = false;
// Debug
bool debugMode = false;
bool debugMode = false;
// Alert history (newest first)
AlertRecord alertHistory[ALERT_HISTORY_SIZE] = {};
int alertHistoryCount = 0;
};
// Touch event passed from display to logic