feat: X3 clock display with DS3231 RTC and NTP sync (#1612)
This commit is contained in:
@@ -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();
|
||||
};
|
||||
Reference in New Issue
Block a user