afreq_ppm = (*drv_set_freq)(afreq_ppm);
- dfreq = (afreq_ppm - current_freq_ppm) / (1.0e6 + current_freq_ppm);
+ dfreq = (afreq_ppm - current_freq_ppm) / (1.0e6 - current_freq_ppm);
LCL_ReadRawTime(&raw);
LCL_CookTime(&raw, &cooked, NULL);
are handled in units of ppm, whereas the 'dfreq' argument is in
terms of the gradient of the (offset) v (local time) function. */
- current_freq_ppm = (1.0 + dfreq) * current_freq_ppm + 1.0e6 * dfreq;
+ current_freq_ppm = (1.0 - dfreq) * current_freq_ppm + 1.0e6 * dfreq;
/* Call the system-specific driver for setting the frequency */
current_freq_ppm = (*drv_set_freq)(current_freq_ppm);
- dfreq = (current_freq_ppm - old_freq_ppm) / (1.0e6 + old_freq_ppm);
+ dfreq = (current_freq_ppm - old_freq_ppm) / (1.0e6 - old_freq_ppm);
LCL_ReadRawTime(&raw);
LCL_CookTime(&raw, &cooked, NULL);
/* Work out new absolute frequency. Note that absolute frequencies
are handled in units of ppm, whereas the 'dfreq' argument is in
terms of the gradient of the (offset) v (local time) function. */
- current_freq_ppm = (1.0 + dfreq) * old_freq_ppm + 1.0e6 * dfreq;
+ current_freq_ppm = (1.0 - dfreq) * old_freq_ppm + 1.0e6 * dfreq;
DEBUG_LOG(LOGF_Local, "old_freq=%.3fppm new_freq=%.3fppm offset=%.6fsec",
old_freq_ppm, current_freq_ppm, doffset);
/* Call the system-specific driver for setting the frequency */
current_freq_ppm = (*drv_set_freq)(current_freq_ppm);
- dfreq = (current_freq_ppm - old_freq_ppm) / (1.0e6 + old_freq_ppm);
+ dfreq = (current_freq_ppm - old_freq_ppm) / (1.0e6 - old_freq_ppm);
(*drv_accrue_offset)(doffset, corr_rate);
if (coefs_valid) {
coef_seconds_fast += doffset;
- coef_gain_rate = (1.0 + dfreq) * (1.0 + coef_gain_rate) - 1.0;
+ coef_gain_rate = (1.0 - dfreq) * coef_gain_rate + dfreq;
}
DEBUG_LOG(LOGF_RtcLinux, "dfreq=%.8f doffset=%.6f old_fast=%.6f old_rate=%.3f new_fast=%.6f new_rate=%.3f",