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
@@ -1,12 +1,14 @@
#include "WifiSelectionActivity.h"
#include <GfxRenderer.h>
#include <HalClock.h>
#include <I18n.h>
#include <Logging.h>
#include <WiFi.h>
#include <map>
#include "CrossPointSettings.h"
#include "MappedInputManager.h"
#include "WifiCredentialStore.h"
#include "activities/util/KeyboardEntryActivity.h"
@@ -248,6 +250,16 @@ void WifiSelectionActivity::checkConnectionStatus() {
connectedIP = ipStr;
autoConnecting = false;
// Sync RTC from NTP on the first successful WiFi connection only. The DS3231
// drifts ~2 ppm so one sync is enough; users can force a re-sync from
// Settings > Customise Status Bar > Sync clock now.
if (halClock.isAvailable() && !SETTINGS.clockHasBeenSynced) {
if (halClock.syncFromNTP()) {
SETTINGS.clockHasBeenSynced = 1;
SETTINGS.saveToFile();
}
}
// Save this as the last connected network - SD card operations need lock as
// we use SPI for both
{