Better estimate RTC offset right after trim

This commit is contained in:
Miroslav Lichvar 2012-02-13 16:54:18 +01:00
parent a60586eaad
commit d6c447a445

View file

@ -1045,9 +1045,10 @@ RTC_Linux_Trim(void)
n_samples = 0; n_samples = 0;
operating_mode = OM_AFTERTRIM; operating_mode = OM_AFTERTRIM;
/* Zero the offset in case writertc is called or chronyd /* Estimate the offset in case writertc is called or chronyd
is terminated during rapid sampling */ is terminated during rapid sampling */
coef_seconds_fast = 0.0; coef_seconds_fast = -now.tv_usec / 1e6 + 0.5;
coef_ref_time = now;
/* And start rapid sampling, interrupts on now */ /* And start rapid sampling, interrupts on now */
if (timeout_running) { if (timeout_running) {