Skip to content

Commit 26727bb

Browse files
committed
Pull request 301
1 parent 89021dd commit 26727bb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/beacon.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,21 @@ static void * beacon_thread (void *arg)
614614
/* i.e. Don't take relative to now in case there was some delay. */
615615

616616
bp->next += bp->every;
617+
618+
// https://github.com/wb2osz/direwolf/pull/301
619+
// https://github.com/wb2osz/direwolf/pull/301
620+
// This happens with a portable system with no Internet connection.
621+
// On reboot, the time is in the past.
622+
// After time gets set from GPS, all beacons from that interval are sent.
623+
// FIXME: This will surely break time slotted scheduling.
624+
625+
/* craigerl: if next beacon is scheduled in the past, then set next beacon relative to now (happens when NTP pushes clock AHEAD) */
626+
/* fixme: if NTP sets clock BACK an hour, this thread will sleep for that hour */
627+
if ( bp->next < now ) {
628+
bp->next = now + bp->every;
629+
text_color_set(DW_COLOR_INFO);
630+
dw_printf("\nSystem clock appears to have jumped forward. Beacon schedule updated.\n\n");
631+
}
617632
}
618633

619634
} /* if time to send it */

0 commit comments

Comments
 (0)