Skip to content

Commit

Permalink
Provide a method to report the sync interval to the clock.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Aug 21, 2012
1 parent 75cdd1f commit 83be79d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 83be79d

Please sign in to comment.