Provide a method to report the sync interval to the clock.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
75cdd1fe15
commit
83be79df13
10
clock.c
10
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;
|
||||
|
|
7
clock.h
7
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.
|
||||
|
|
Loading…
Reference in New Issue