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:
1 parent
99656142f1
commit
8b55e36f95
5 files changed
+94
-114
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user