Apply utc offset correction even when free running.
When using software time stamping and a free running clock, the statistics appear to be off by the TAI offset. This patch fixes the issue by setting the internal UTC timescale flag in such cases. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
fce0aa0a2f
commit
2ec3829bd4
3
clock.c
3
clock.c
|
@ -574,6 +574,9 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count,
|
|||
|
||||
if (c->free_running) {
|
||||
c->clkid = CLOCK_INVALID;
|
||||
if (timestamping == TS_SOFTWARE || timestamping == TS_LEGACY_HW) {
|
||||
c->utc_timescale = 1;
|
||||
}
|
||||
} else if (phc_index >= 0) {
|
||||
snprintf(phc, 31, "/dev/ptp%d", phc_index);
|
||||
c->clkid = phc_open(phc);
|
||||
|
|
Loading…
Reference in New Issue