diff --git a/clock.c b/clock.c index a3cdd71..33bcb54 100644 --- a/clock.c +++ b/clock.c @@ -601,6 +601,16 @@ enum servo_state clock_synchronize(struct clock *c, return state; } +void clock_sync_interval(struct clock *c, int n) +{ + int shift = c->dds.freq_est_interval - n; + + if (shift < 0) + shift = 0; + + c->fest.max_count = (1 << shift); +} + struct timePropertiesDS *clock_time_properties(struct clock *c) { return &c->tds; diff --git a/clock.h b/clock.h index 2566aa7..92c61d4 100644 --- a/clock.h +++ b/clock.h @@ -184,6 +184,13 @@ enum servo_state clock_synchronize(struct clock *c, Integer64 correction1, Integer64 correction2); +/** + * Inform a slaved clock about the master's sync interval. + * @param c The clock instance. + * @param n The logarithm base two of the sync interval. + */ +void clock_sync_interval(struct clock *c, int n); + /** * Obtain a clock's time properties data set. * @param c The clock instance.