Public Access
- Web UI on port 80: live view of the display, choose the page (clock or a bitmap), bitmaps (list, show, live, edit, delete), draw / image upload with conversion in the browser, live mode, settings, Home Assistant - Live view from a shadow buffer in the BROSE9323 driver (shownPixel) - Settings in NVS with the original behaviour as defaults: schedule times, quarter hours, yawning Pikachu, No WiFi screen, flip time, status LED, Home Assistant broker (restart on change) - Bitmaps on LittleFS; new 320 KB partition, ota slots now 1.31 MB - DisplayController: pages, live mode, settings; app.cpp holds the objects - README for the recovery app; docs for the web UI - Tests: settings, time parsing, bitmap format and names, schedule with settings, pages and live mode (95 total) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.3 KiB
C
38 lines
1.3 KiB
C
#pragma once
|
|
|
|
// The objects of the clock firmware and the actions the web UI and Home Assistant use.
|
|
// main.cpp only decides the order of things at boot and in loop().
|
|
|
|
#include "BROSE9323.h"
|
|
#include "display/frames.h"
|
|
#include "display/status_screen.h"
|
|
#include "logic/display_controller.h"
|
|
#include "logic/settings.h"
|
|
#include "nano_link/nano_link.h"
|
|
|
|
extern NanoLink nano;
|
|
extern BROSE9323 display;
|
|
extern FlipdotFrames frames;
|
|
extern StatusScreen status;
|
|
extern DisplayController controller;
|
|
|
|
// Settings: loaded at boot, changed in the web UI
|
|
const Settings &appSettings();
|
|
void appLoadSettings();
|
|
// Validates, stores and applies. Returns nullptr or an error message. Sets
|
|
// restart_needed when the change only works after a restart (Home Assistant).
|
|
const char *appSaveSettings(const Settings &settings, bool &restart_needed);
|
|
|
|
// The page shown during the day: PAGE_CLOCK or a bitmap name (stored in the settings)
|
|
const char *appSelectPage(const char *name);
|
|
// A bitmap was saved or deleted: redraw when it is the current page
|
|
void appBitmapChanged(const char *name);
|
|
|
|
// Live mode of the web UI
|
|
void appShowLive(const uint8_t *bitmap);
|
|
void appStopLive();
|
|
|
|
// Restart the ESP32 after `delay_ms` (so a web response can still be sent)
|
|
void appRestartLater(uint32_t delay_ms);
|
|
void appLoop();
|