nrf52: hodiny přežijí warm reset v .noinit (#5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-10-18 22:17:40 +02:00
1 parent cd71436b74
commit 21425b5d65
5 files changed
+94 -114

No files matched your search

+6 -1
View File
@@ -64,7 +64,12 @@ void BaseChatMesh::bootstrapRTCfromContacts() {
latest = contacts[i].lastmod;
}
}
if (latest != 0) {
// CUSTOM (TeTeHacko): only ever forward. Upstream sets this unconditionally,
// which was harmless while the clock started in 2024; ours starts at the build
// epoch (or a time retained across a warm reset, read by getCurrentTime()
// here), and an old contact would otherwise pull the clock back -- and, on
// nRF52, cancel the retained-clock restore it ran ahead of.
if (latest != 0 && latest + 1 > getRTCClock()->getCurrentTime()) {
getRTCClock()->setCurrentTime(latest + 1);
}
}