mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:05:06 -05:00
hwclock: don't drop valid samples in HCL_ProcessReadings()
Modify the HCL_ProcessReadings() function to try to always provide a valid sample. Instead of dropping a sample outside of the expected delay, provide its assumed quality level as a small integer (relative to already accumulated samples), and let the caller decide what quality is acceptable.
This commit is contained in:
10
hwclock.h
10
hwclock.h
@@ -38,10 +38,14 @@ extern void HCL_DestroyInstance(HCL_Instance clock);
|
||||
/* Check if a new sample should be accumulated at this time */
|
||||
extern int HCL_NeedsNewSample(HCL_Instance clock, struct timespec *now);
|
||||
|
||||
/* Process new readings of the HW clock in form of (sys, hw, sys) triplets and
|
||||
produce a sample which can be accumulated */
|
||||
/* Process new readings of the HW clock in the form of (sys, hw, sys) triplets
|
||||
and produce a sample which can be accumulated by HCL_AccumulateSample().
|
||||
Indicate the quality of the sample relative to already processed samples as
|
||||
a value of 0, 1, or 2, where a sample of quality 0 should normally be
|
||||
dropped. */
|
||||
extern int HCL_ProcessReadings(HCL_Instance clock, int n_readings, struct timespec tss[][3],
|
||||
struct timespec *hw_ts, struct timespec *local_ts, double *err);
|
||||
struct timespec *hw_ts, struct timespec *local_ts, double *err,
|
||||
int *quality);
|
||||
|
||||
/* Accumulate a new sample */
|
||||
extern void HCL_AccumulateSample(HCL_Instance clock, struct timespec *hw_ts,
|
||||
|
||||
Reference in New Issue
Block a user