feat: add silent NTP time sync on boot via saved WiFi credentials
New "Auto Sync on Boot" toggle in Clock Settings. When enabled, a background FreeRTOS task scans for saved WiFi networks at boot, connects, syncs time via NTP, then tears down WiFi — all without blocking boot or requiring user interaction. If no saved network is found after two scan attempts (with a 3-second retry gap), it bails silently. Conflict guards (BootNtpSync::cancel()) added to all WiFi-using activities so the background task cleans up before any user-initiated WiFi flow. Also fixes clock not appearing in the header until a button press by detecting the invalid→valid time transition after NTP sync. Made-with: Cursor
This commit is contained in:
@@ -91,6 +91,8 @@ inline std::vector<SettingInfo> getSettingsList() {
|
||||
{StrId::STR_TZ_UTC, StrId::STR_TZ_EASTERN, StrId::STR_TZ_CENTRAL, StrId::STR_TZ_MOUNTAIN,
|
||||
StrId::STR_TZ_PACIFIC, StrId::STR_TZ_ALASKA, StrId::STR_TZ_HAWAII, StrId::STR_TZ_CUSTOM},
|
||||
"timezone", StrId::STR_CAT_CLOCK),
|
||||
SettingInfo::Toggle(StrId::STR_AUTO_NTP_SYNC, &CrossPointSettings::autoNtpSync, "autoNtpSync",
|
||||
StrId::STR_CAT_CLOCK),
|
||||
|
||||
// --- Reader ---
|
||||
SettingInfo::DynamicEnum(
|
||||
|
||||
Reference in New Issue
Block a user