mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-09-02 18:33:47 +00:00
meshtimesync p1
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user