Adding experimental RTC temperature compensation

This commit is contained in:
jpirnay
2026-03-29 18:19:35 +02:00
parent ba5b0b9191
commit 4f92a9935e
3 changed files with 259 additions and 22 deletions
+8
View File
@@ -51,6 +51,14 @@ time_t now();
/// True if the clock has been set at least once (NTP or restore).
bool isSynced();
/// Periodic callback (called from main loop) to compensate temperature-induced
/// RTC drift while the device is awake. Runs at a 10-minute interval.
/// Computes the drift delta since the last baseline using the temperature
/// model and nudges the system clock by only that delta (the kernel clock
/// already advanced the raw amount). Drift state is persisted to NVS only
/// in saveBeforeSleep() to minimise flash wear.
void updatePeriodic();
/// True if the last restore was from a backup (not NTP) — i.e. the clock
/// may have drifted. Cleared on NTP sync.
bool isApproximate();