Skip to content

Commit

Permalink
Dont apply/subtract clock sync offset from NEVER/FOREVER
Browse files Browse the repository at this point in the history
  • Loading branch information
erlingrj committed May 13, 2024
1 parent f35c5f1 commit e5fef0c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/federated/clock-sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,17 @@ void* listen_to_rti_UDP_thread(void* args) {
// If clock synchronization is enabled, provide implementations. If not
// just empty implementations that should be optimized away.
#if (LF_CLOCK_SYNC >= LF_CLOCK_SYNC_INIT)
void clock_sync_add_offset(instant_t* t) { *t += (_lf_clock_sync_offset + _lf_clock_sync_constant_bias); }
void clock_sync_add_offset(instant_t* t) {
if (*t != FOREVER && *t != NEVER) {
*t += (_lf_clock_sync_offset + _lf_clock_sync_constant_bias);
}
}

void clock_sync_subtract_offset(instant_t* t) { *t -= (_lf_clock_sync_offset + _lf_clock_sync_constant_bias); }
void clock_sync_subtract_offset(instant_t* t) {
if (*t != FOREVER && *t != NEVER) {
*t -= (_lf_clock_sync_offset + _lf_clock_sync_constant_bias);
}
}

void clock_sync_set_constant_bias(interval_t offset) { _lf_clock_sync_constant_bias = offset; }
#else // i.e. (LF_CLOCK_SYNC < LF_CLOCK_SYNC_INIT)
Expand Down

0 comments on commit e5fef0c

Please sign in to comment.