mod: fix clock bugs, add NTP auto-sync, show clock in all headers
- Fix SetTimeActivity immediately dismissing by changing wasReleased to wasPressed for all button inputs (matching other subactivities) - Extract NTP sync into shared TimeSync utility (startNtpSync, waitForNtpSync, stopNtpSync) and trigger non-blocking NTP sync on every WiFi connection - Move clock rendering into drawHeader (BaseTheme + LyraTheme) so it appears on all screens with a header, positioned symmetrically with the battery icon (12px margin, same Y offset, SMALL_FONT_ID) - Add per-minute auto-refresh on home screen so clock updates without button press - Add RTC time debug log on boot to verify time persistence across deep sleep Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "activities/util/KeyboardEntryActivity.h"
|
||||
#include "components/UITheme.h"
|
||||
#include "fontIds.h"
|
||||
#include "util/TimeSync.h"
|
||||
|
||||
void WifiSelectionActivity::onEnter() {
|
||||
Activity::onEnter();
|
||||
@@ -243,6 +244,9 @@ void WifiSelectionActivity::checkConnectionStatus() {
|
||||
connectedIP = ipStr;
|
||||
autoConnecting = false;
|
||||
|
||||
// Start NTP time sync in the background (non-blocking)
|
||||
TimeSync::startNtpSync();
|
||||
|
||||
// Save this as the last connected network - SD card operations need lock as
|
||||
// we use SPI for both
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user