mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
refclock: improve precision with large offset
If a SHM or PHC refclock has a very large offset compensated by the offset option, or ignored with the pps or local option, there is a persistent loss of precision in the calculation of the sample offset using the double format. Rework the code to delay the calculation of the accumulated offset to include the specificed compensation and remaining correction of the system clock, where the calculation can be split to improve the precision. In the pps mode ignore integer seconds competely. The precision of the SOCK refclock is now limited to 1 nanosecond due to the extra double->timespec->double conversion.
This commit is contained in:
@@ -75,7 +75,8 @@ extern void *RCL_GetDriverData(RCL_Instance instance);
|
||||
extern char *RCL_GetDriverParameter(RCL_Instance instance);
|
||||
extern void RCL_CheckDriverOptions(RCL_Instance instance, const char **options);
|
||||
extern char *RCL_GetDriverOption(RCL_Instance instance, char *name);
|
||||
extern int RCL_AddSample(RCL_Instance instance, struct timespec *sample_time, double offset, int leap);
|
||||
extern int RCL_AddSample(RCL_Instance instance, struct timespec *sample_time,
|
||||
struct timespec *ref_time, int leap);
|
||||
extern int RCL_AddPulse(RCL_Instance instance, struct timespec *pulse_time, double second);
|
||||
extern int RCL_AddCookedPulse(RCL_Instance instance, struct timespec *cooked_time,
|
||||
double second, double dispersion, double raw_correction);
|
||||
|
||||
Reference in New Issue
Block a user