Files
Flipdot-display/src/esp32/app.h
T

39 lines
1.4 KiB
C
Raw Normal View History

2026-10-13 01:52:34 +02:00
#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);
// Left on the dots when the display switches off: OFF_PAGE_BLANK or a bitmap name
const char *appSelectOffPage(const char *name);
// A bitmap was saved or deleted: redraw when it is the current page or off image
2026-10-13 01:52:34 +02:00
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();