Keep receiver timesync fast and extend sender fast window
- Receiver now sends time sync every 60s indefinitely (mains powered) - Sender stays in fast timesync listen mode for first 60s even with RTC
This commit is contained in:
@@ -158,7 +158,7 @@ static bool battery_sample_due(uint32_t now_ms) {
|
||||
|
||||
static bool sender_timesync_window_due() {
|
||||
uint32_t interval_sec = SENDER_TIMESYNC_CHECK_SEC_FAST;
|
||||
if (time_is_synced() && time_rtc_present()) {
|
||||
if (millis() - g_boot_ms >= 60000UL && time_is_synced() && time_rtc_present()) {
|
||||
interval_sec = SENDER_TIMESYNC_CHECK_SEC_SLOW;
|
||||
}
|
||||
if (g_sender_last_timesync_check_ms == 0) {
|
||||
@@ -1005,9 +1005,6 @@ static void receiver_loop() {
|
||||
}
|
||||
|
||||
uint32_t interval_sec = TIME_SYNC_INTERVAL_SEC;
|
||||
if (time_rtc_present() && millis() - g_boot_ms >= TIME_SYNC_FAST_WINDOW_MS) {
|
||||
interval_sec = TIME_SYNC_SLOW_INTERVAL_SEC;
|
||||
}
|
||||
if (!g_ap_mode && millis() - g_last_timesync_ms > interval_sec * 1000UL) {
|
||||
g_last_timesync_ms = millis();
|
||||
if (!time_send_timesync(g_short_id)) {
|
||||
|
||||
Reference in New Issue
Block a user