mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-06 23:57:39 +03:00
- Add CALENDAR sleep mode that bypasses /sleep/ directory to ensure calendar image displays
- Implement CalendarActivity state machine: WiFi→NTP→HTTP fetch→save to /sleep.bmp→deep sleep
- Add NTP time sync and fetch timestamp persistence in CrossPointState
- Show visual status feedback during calendar fetch ("Connecting...", "Fetching...")
- Add calendar settings UI: toggle, refresh hours (1-24h), "Test Calendar Now" action
- Fix hardware button sleep to display calendar when calendar mode enabled
- Graceful fallback: if fetch fails but cached image exists, use cached; otherwise use default screen
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
25 lines
539 B
C++
25 lines
539 B
C++
#pragma once
|
|
#include <iosfwd>
|
|
#include <string>
|
|
|
|
class CrossPointState {
|
|
// Static instance
|
|
static CrossPointState instance;
|
|
|
|
public:
|
|
std::string openEpubPath;
|
|
uint8_t lastSleepImage;
|
|
uint32_t lastCalendarFetch = 0; // Unix epoch of last successful calendar fetch
|
|
~CrossPointState() = default;
|
|
|
|
// Get singleton instance
|
|
static CrossPointState& getInstance() { return instance; }
|
|
|
|
bool saveToFile() const;
|
|
|
|
bool loadFromFile();
|
|
};
|
|
|
|
// Helper macro to access settings
|
|
#define APP_STATE CrossPointState::getInstance()
|