mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 18:35:06 -05:00
refclock: add option to treat non-PPS refclocks as PPS
Add pps option to the refclock directive to force chronyd to treat any refclock as a PPS refclock. This is intended for refclocks that may provide time off by a whole number of seconds due to missing or wrong TAI/GPS->UTC conversion.
This commit is contained in:
7
conf.c
7
conf.c
@@ -674,7 +674,7 @@ static void
|
||||
parse_refclock(char *line)
|
||||
{
|
||||
int n, poll, dpoll, filter_length, pps_rate, min_samples, max_samples, sel_options;
|
||||
int max_lock_age;
|
||||
int max_lock_age, pps_forced;
|
||||
uint32_t ref_id, lock_ref_id;
|
||||
double offset, delay, precision, max_dispersion;
|
||||
char *p, *cmd, *name, *param;
|
||||
@@ -684,6 +684,7 @@ parse_refclock(char *line)
|
||||
poll = 4;
|
||||
dpoll = 0;
|
||||
filter_length = 64;
|
||||
pps_forced = 0;
|
||||
pps_rate = 0;
|
||||
min_samples = SRC_DEFAULT_MINSAMPLES;
|
||||
max_samples = SRC_DEFAULT_MAXSAMPLES;
|
||||
@@ -756,6 +757,9 @@ parse_refclock(char *line)
|
||||
} else if (!strcasecmp(cmd, "delay")) {
|
||||
if (sscanf(line, "%lf%n", &delay, &n) != 1)
|
||||
break;
|
||||
} else if (!strcasecmp(cmd, "pps")) {
|
||||
n = 0;
|
||||
pps_forced = 1;
|
||||
} else if (!strcasecmp(cmd, "precision")) {
|
||||
if (sscanf(line, "%lf%n", &precision, &n) != 1)
|
||||
break;
|
||||
@@ -791,6 +795,7 @@ parse_refclock(char *line)
|
||||
refclock->driver_poll = dpoll;
|
||||
refclock->poll = poll;
|
||||
refclock->filter_length = filter_length;
|
||||
refclock->pps_forced = pps_forced;
|
||||
refclock->pps_rate = pps_rate;
|
||||
refclock->min_samples = min_samples;
|
||||
refclock->max_samples = max_samples;
|
||||
|
||||
Reference in New Issue
Block a user