- 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>
21 lines
591 B
C++
21 lines
591 B
C++
#pragma once
|
|
#include "../Activity.h"
|
|
|
|
class Bitmap;
|
|
|
|
class SleepActivity final : public Activity {
|
|
public:
|
|
explicit SleepActivity(GfxRenderer& renderer, MappedInputManager& mappedInput)
|
|
: Activity("Sleep", renderer, mappedInput) {}
|
|
void onEnter() override;
|
|
|
|
private:
|
|
void renderPopup(const char* message) const;
|
|
void renderDefaultSleepScreen() const;
|
|
void renderCustomSleepScreen() const;
|
|
void renderCalendarSleepScreen() const;
|
|
void renderCoverSleepScreen() const;
|
|
void renderBitmapSleepScreen(const Bitmap& bitmap) const;
|
|
void renderBlankSleepScreen() const;
|
|
};
|