Provide a method to report the sync interval to the clock.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-08-21 20:04:45 +02:00
parent 75cdd1fe15
commit 83be79df13
2 changed files with 17 additions and 0 deletions

10
clock.c
View File

@ -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;

View File

@ -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.