mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:25:07 -05:00
refclock: increase PPS lock limit
Increase the maximum acceptable offset of the PPS lock reference from 20% to 40% of the PPS interval to not require the refclock offset to be specified in configuration so accurately, or enable operation with a highly unstable reference clock.
This commit is contained in:
@@ -40,6 +40,9 @@
|
|||||||
#include "samplefilt.h"
|
#include "samplefilt.h"
|
||||||
#include "sched.h"
|
#include "sched.h"
|
||||||
|
|
||||||
|
/* Maximum offset of locked reference as a fraction of the PPS interval */
|
||||||
|
#define PPS_LOCK_LIMIT 0.4
|
||||||
|
|
||||||
/* list of refclock drivers */
|
/* list of refclock drivers */
|
||||||
extern RefclockDriver RCL_SHM_driver;
|
extern RefclockDriver RCL_SHM_driver;
|
||||||
extern RefclockDriver RCL_SOCK_driver;
|
extern RefclockDriver RCL_SOCK_driver;
|
||||||
@@ -577,7 +580,7 @@ RCL_AddCookedPulse(RCL_Instance instance, struct timespec *cooked_time,
|
|||||||
offset += shift;
|
offset += shift;
|
||||||
|
|
||||||
if (fabs(ref_sample.offset - offset) +
|
if (fabs(ref_sample.offset - offset) +
|
||||||
ref_sample.root_dispersion + dispersion >= 0.2 / rate) {
|
ref_sample.root_dispersion + dispersion > PPS_LOCK_LIMIT / rate) {
|
||||||
DEBUG_LOG("refclock pulse ignored offdiff=%.9f refdisp=%.9f disp=%.9f",
|
DEBUG_LOG("refclock pulse ignored offdiff=%.9f refdisp=%.9f disp=%.9f",
|
||||||
ref_sample.offset - offset, ref_sample.root_dispersion, dispersion);
|
ref_sample.offset - offset, ref_sample.root_dispersion, dispersion);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user