Skip to content

Measure RTC drift at each NTP sync - #42

Merged
maorun merged 1 commit into
masterfrom
maorun/rtc-drift-measurement
Nov 11, 2026
Merged

maorun merged 1 commit into
masterfrom
maorun/rtc-drift-measurement

Conversation

@maorun

@maorun maorun commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Read the PCF85063A time before each NTP write. Calculate the drift in seconds and the rate in ppm since the previous sync.
  • Store the last drift and rate in RTC memory. The state version is now 21. The old format gives a clean start.
  • Show RTC DRIFT: +N S (+N PPM) in the diagnostics view. Show RTC DRIFT: -- before the second sync.
  • Skip the rate for a sync less than 1 h after the previous one. Build the reference with the UTC offset of the previous sync, so a DST change shows no false hour.

Validation

  • c++ -std=c++17 -Wall -Wextra -Werror tests/test_firmware_logic.cpp -o test_runner && ./test_runner: passed, 134 suites, local.
  • arduino-cli compile rlcd_panel: passed, local.
  • ./scripts/generate-display-preview.sh: passed, local.
  • Review gate: 2 cycles. Cycle 1 had 3 MEDIUM and 5 LOW findings, all fixed. Cycle 2 had 4 LOW findings, all fixed.
  • Not run: hardware test on the board.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@maorun
maorun merged commit 485d1b7 into master Nov 11, 2026
2 checks passed
@maorun
maorun deleted the maorun/rtc-drift-measurement branch November 11, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant