/* Dispatch to all handlers */
for (ptr = change_list.next; ptr != &change_list; ptr = ptr->next) {
- (ptr->handler)(&raw, &cooked, dfreq, afreq_ppm, 0.0, 0, ptr->anything);
+ (ptr->handler)(&raw, &cooked, dfreq, 0.0, 0, ptr->anything);
}
current_freq_ppm = afreq_ppm;
/* Dispatch to all handlers */
for (ptr = change_list.next; ptr != &change_list; ptr = ptr->next) {
- (ptr->handler)(&raw, &cooked, dfreq, current_freq_ppm, 0.0, 0, ptr->anything);
+ (ptr->handler)(&raw, &cooked, dfreq, 0.0, 0, ptr->anything);
}
}
/* Dispatch to all handlers */
for (ptr = change_list.next; ptr != &change_list; ptr = ptr->next) {
- (ptr->handler)(&raw, &cooked, 0.0, current_freq_ppm, offset, 0, ptr->anything);
+ (ptr->handler)(&raw, &cooked, 0.0, offset, 0, ptr->anything);
}
}
/* Dispatch to all handlers */
for (ptr = change_list.next; ptr != &change_list; ptr = ptr->next) {
- (ptr->handler)(&raw, &cooked, 0.0, current_freq_ppm, offset, 1, ptr->anything);
+ (ptr->handler)(&raw, &cooked, 0.0, offset, 1, ptr->anything);
}
}
/* Dispatch to all handlers */
for (ptr = change_list.next; ptr != &change_list; ptr = ptr->next) {
- (ptr->handler)(&raw, &cooked, dfreq, current_freq_ppm, doffset, 0, ptr->anything);
+ (ptr->handler)(&raw, &cooked, dfreq, doffset, 0, ptr->anything);
}
dfreq : delta frequency relative to previous value (in terms of
seconds gained by system clock per unit system clock time)
- afreq : absolute frequency relative to uncompensated system (in
- terms of ppm seconds gained by system clock per unit of the
- uncalibrated system clock)
-
doffset : delta offset applied (positive => make local system fast
by that amount, negative => make it slow by that amount)
typedef void (*LCL_ParameterChangeHandler)
(struct timeval *raw, struct timeval *cooked,
- double dfreq, double afreq_ppm,
+ double dfreq,
double doffset, int is_step_change,
void *anything
);
slew_samples(struct timeval *raw,
struct timeval *cooked,
double dfreq,
- double afreq,
double doffset,
int is_step_change,
void *not_used);
slew_samples(struct timeval *raw,
struct timeval *cooked,
double dfreq,
- double afreq,
double doffset,
int is_step_change,
void *not_used)
slew_sources(struct timeval *raw,
struct timeval *cooked,
double dfreq,
- double afreq,
double doffset,
int is_step_change,
void *anything);
slew_sources(struct timeval *raw,
struct timeval *cooked,
double dfreq,
- double afreq,
double doffset,
int is_step_change,
void *anything)
static int valid_sample_time(RCL_Instance instance, struct timeval *tv);
static int pps_stratum(RCL_Instance instance, struct timeval *tv);
static void poll_timeout(void *arg);
-static void slew_samples(struct timeval *raw, struct timeval *cooked, double dfreq, double afreq,
+static void slew_samples(struct timeval *raw, struct timeval *cooked, double dfreq,
double doffset, int is_step_change, void *anything);
static void add_dispersion(double dispersion, void *anything);
static void log_sample(RCL_Instance instance, struct timeval *sample_time, int filtered, int pulse, double raw_offset, double cooked_offset, double dispersion);
}
static void
-slew_samples(struct timeval *raw, struct timeval *cooked, double dfreq, double afreq,
+slew_samples(struct timeval *raw, struct timeval *cooked, double dfreq,
double doffset, int is_step_change, void *anything)
{
int i;
static void
slew_samples
(struct timeval *raw, struct timeval *cooked,
- double dfreq, double afreq_ppm,
+ double dfreq,
double doffset, int is_step_change,
void *anything)
{
int i;
double elapsed;
- double new_freq;
- double old_freq;
double delta_time;
double old_seconds_fast, old_gain_rate;
- new_freq = 1.0e-6 * afreq_ppm;
- old_freq = (new_freq - dfreq) / (1.0 + dfreq);
-
for (i=0; i<n_samples; i++) {
UTI_DiffTimevalsToDouble(&elapsed, cooked, system_times + i);
if (coefs_valid) {
coef_seconds_fast += doffset;
- coef_gain_rate = 1.0 - ((1.0 + new_freq) / (1.0 + old_freq)) * (1.0 - coef_gain_rate);
+ coef_gain_rate = 1.0 - (1.0 + dfreq) * (1.0 - coef_gain_rate);
}
#if 0
- LOG(LOGS_INFO, LOGF_RtcLinux, "dfreq=%.8f doffset=%.6f new_freq=%.3f old_freq=%.3f old_fast=%.6f old_rate=%.3f new_fast=%.6f new_rate=%.3f",
- dfreq, doffset, 1.0e6*new_freq, 1.0e6*old_freq,
+ LOG(LOGS_INFO, LOGF_RtcLinux, "dfreq=%.8f doffset=%.6f old_fast=%.6f old_rate=%.3f new_fast=%.6f new_rate=%.3f",
+ dfreq, doffset,
old_seconds_fast, 1.0e6 * old_gain_rate,
coef_seconds_fast, 1.0e6 * coef_gain_rate);
#endif
handle_slew(struct timeval *raw,
struct timeval *cooked,
double dfreq,
- double afreq,
double doffset,
int is_step_change,
void *anything);
handle_slew(struct timeval *raw,
struct timeval *cooked,
double dfreq,
- double afreq,
double doffset,
int is_step_change,
void *anything)
/* Forward prototype */
static void
-slew_sources(struct timeval *raw, struct timeval *cooked, double dfreq, double afreq,
+slew_sources(struct timeval *raw, struct timeval *cooked, double dfreq,
double doffset, int is_step_change, void *anything);
static void
add_dispersion(double dispersion, void *anything);
slew_sources(struct timeval *raw,
struct timeval *cooked,
double dfreq,
- double afreq,
double doffset,
int is_step_change,
void *anything)