local: cancel remaining correction after external step
Instead of the generic clock driver silently zeroing the remaining offset after detecting an external step, cancel it properly with the slew handlers in order to correct timestamps that are not reset in handling of the unknown step (e.g. the NTP local TX).
This commit is contained in:
parent
a0a496dcb4
commit
9cc609c4b0
2 changed files with 3 additions and 6 deletions
2
local.c
2
local.c
|
@ -563,6 +563,8 @@ void
|
||||||
LCL_NotifyExternalTimeStep(struct timespec *raw, struct timespec *cooked,
|
LCL_NotifyExternalTimeStep(struct timespec *raw, struct timespec *cooked,
|
||||||
double offset, double dispersion)
|
double offset, double dispersion)
|
||||||
{
|
{
|
||||||
|
LCL_CancelOffsetCorrection();
|
||||||
|
|
||||||
/* Dispatch to all handlers */
|
/* Dispatch to all handlers */
|
||||||
invoke_parameter_change_handlers(raw, cooked, 0.0, offset, LCL_ChangeUnknownStep);
|
invoke_parameter_change_handlers(raw, cooked, 0.0, offset, LCL_ChangeUnknownStep);
|
||||||
|
|
||||||
|
|
|
@ -109,12 +109,7 @@ static void
|
||||||
handle_step(struct timespec *raw, struct timespec *cooked, double dfreq,
|
handle_step(struct timespec *raw, struct timespec *cooked, double dfreq,
|
||||||
double doffset, LCL_ChangeType change_type, void *anything)
|
double doffset, LCL_ChangeType change_type, void *anything)
|
||||||
{
|
{
|
||||||
if (change_type == LCL_ChangeUnknownStep) {
|
if (change_type == LCL_ChangeStep) {
|
||||||
/* Reset offset and slewing */
|
|
||||||
slew_start = *raw;
|
|
||||||
offset_register = 0.0;
|
|
||||||
update_slew();
|
|
||||||
} else if (change_type == LCL_ChangeStep) {
|
|
||||||
UTI_AddDoubleToTimespec(&slew_start, -doffset, &slew_start);
|
UTI_AddDoubleToTimespec(&slew_start, -doffset, &slew_start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue