Fix GlobalTime tick drift and blocking NTP/timezone retries #334
No reviewers
Labels
No labels
bug
conflicts
documentation
DO NOT MERGE
duplicate
enhancement
good first issue
hardware
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
greg/info-orbs!334
Loading…
Reference in a new issue
No description provided.
Delete branch "Bullpuph123/fix/globaltime-tick-drift"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split from #330 (part 1 of 3), rebased onto dev as requested.
Summary
updateTime()usedm_updateTimer = millis()after a>comparison, which accumulates drift and eventually skips seconds (visible as irregular colon blink / tick jumps). The timer now advances by whole 1000ms periods, staying phase-locked to the second grid. All comparisons use rollover-safe unsigned arithmetic (millis() wraps at ~49.7 days).forceUpdate()blocks ~1010ms on timeout without advancing_lastUpdate, so once an update is due, a dead/unreachable NTP server stalls every loop iteration by ~1s (the whole UI degrades to ~1Hz). NTP attempts are now rate-limited (61s once synced, 5s until first sync) so a failing server costs at most one blocked call per interval.Test plan
pio run -e infoorbs-v0_3firmware/test/host_sim_long_uptime.py) covering scheduler drift, uint32 rollover, and NTP-failure stall behavior — all checks pass🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.