meshtimesync p1

This commit is contained in:
liquidraver
2026-07-03 09:11:43 +02:00
parent fc940d27ba
commit 14cb8c61f9
30 changed files with 1231 additions and 3 deletions
+16
View File
@@ -525,6 +525,12 @@ static void mesh_event_loop(void)
mesh_housekeeping_ui_refresh();
/* Mesh time-sync paced evaluation — loop() only runs on
* packet-driven events, so drive the 15-min tick here. */
if (companion_mesh_ptr) {
companion_mesh_ptr->timeSyncTick();
}
/* Low-battery auto-shutdown (companion only). Self-throttled
* and compiled out unless the board sets a threshold — no
* extra poll, just a cheap call on the existing tick. */
@@ -546,6 +552,12 @@ static void mesh_event_loop(void)
* write here on the main thread instead. */
if (events & MESH_EVENT_RTC_SAVE) {
zephcore_rtc_save((uint32_t)atomic_get(&pending_rtc_epoch));
#ifdef ZEPHCORE_LORA
/* GPS just set the clock — arm the mesh time-sync drift envelope. */
if (companion_mesh_ptr) {
companion_mesh_ptr->noteGPSTimeSync();
}
#endif
}
#if IS_ENABLED(CONFIG_ZEPHCORE_UI_DESIGN_JOYSTICK)
@@ -703,6 +715,10 @@ public:
int timeout_mins) override {
(void)freq; (void)bw; (void)sf; (void)cr; (void)timeout_mins;
}
MeshTimeSync* getMeshTimeSync() override {
return companion_mesh.getMeshTimeSync();
}
};
static CompanionCLICallbacks companion_cli_cbs;
+6
View File
@@ -447,6 +447,12 @@ static void repeater_event_loop(void)
* write here on the main thread instead. */
if (events & MESH_EVENT_RTC_SAVE) {
zephcore_rtc_save((uint32_t)atomic_get(&pending_rtc_epoch));
#ifdef ZEPHCORE_LORA
/* GPS just set the clock — arm the mesh time-sync drift envelope. */
if (repeater_mesh_ptr) {
repeater_mesh_ptr->noteGPSTimeSync();
}
#endif
}
}
}
+6
View File
@@ -465,6 +465,12 @@ static void room_event_loop(void)
* write here on the main thread instead. */
if (events & MESH_EVENT_RTC_SAVE) {
zephcore_rtc_save((uint32_t)atomic_get(&pending_rtc_epoch));
#ifdef ZEPHCORE_LORA
/* GPS just set the clock — arm the mesh time-sync drift envelope. */
if (room_mesh_ptr) {
room_mesh_ptr->noteGPSTimeSync();
}
#endif
}
}
}