feat: X3 clock display with DS3231 RTC and NTP sync (#1612)

This commit is contained in:
Justinian
2026-05-18 21:06:56 -04:00
committed by GitHub
parent 151bf1dae4
commit cfd3a381ed
14 changed files with 836 additions and 57 deletions
@@ -0,0 +1,24 @@
#pragma once
#include "activities/Activity.h"
// Manual NTP resync action. Runs a forced sync (bypassing the once-per-device debounce),
// reports success/failure, then waits for Back. Requires WiFi to already be connected.
class ClockSyncActivity final : public Activity {
public:
explicit ClockSyncActivity(GfxRenderer& renderer, MappedInputManager& mappedInput)
: Activity("ClockSync", renderer, mappedInput) {}
void onEnter() override;
void onExit() override;
void loop() override;
bool skipLoopDelay() override { return true; }
void render(RenderLock&&) override;
private:
enum State { SYNCING, SUCCESS, NO_WIFI, FAILED };
State state = SYNCING;
char syncedTime[16] = {0};
void runSync();
};