This commit is contained in:
2026-02-16 03:14:38 -08:00
parent 67fd36bffb
commit 893c50dbc0
7 changed files with 255 additions and 304 deletions

View File

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