hwclock: fix conversion of HW timestamps
Fix a sign error in conversion of HW time to local time, which caused the jitter to be amplified instead of reduced. NTP with HW timestamping should now be more stable and able to ignore occasionally delayed readings of PHC.
This commit is contained in:
parent
be8215e181
commit
4534db84c4
1 changed files with 1 additions and 1 deletions
|
@ -198,7 +198,7 @@ HCL_CookTime(HCL_Instance clock, struct timespec *raw, struct timespec *cooked,
|
|||
return 0;
|
||||
|
||||
elapsed = UTI_DiffTimespecsToDouble(raw, &clock->hw_ref);
|
||||
offset = clock->offset + elapsed / clock->frequency;
|
||||
offset = elapsed / clock->frequency - clock->offset;
|
||||
UTI_AddDoubleToTimespec(&clock->local_ref, offset, cooked);
|
||||
|
||||
/* Fow now, just return the error of the last sample */
|
||||
|
|
Loading…
Reference in a new issue