phc2sys: Set servo sync interval.

[RC: merged servo_sync_interval signature change with earlier patch]

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2013-07-07 14:14:25 +02:00 committed by Richard Cochran
parent 6edbea4996
commit 639ebbca13
1 changed files with 5 additions and 1 deletions

View File

@ -782,8 +782,12 @@ int main(int argc, char *argv[])
dst_clock.servo = servo_create(CLOCK_SERVO_PI, -ppb, max_ppb, 0); dst_clock.servo = servo_create(CLOCK_SERVO_PI, -ppb, max_ppb, 0);
if (pps_fd >= 0) if (pps_fd >= 0) {
servo_sync_interval(dst_clock.servo, 1.0);
return do_pps_loop(&dst_clock, pps_fd, src, phc_readings); return do_pps_loop(&dst_clock, pps_fd, src, phc_readings);
}
servo_sync_interval(dst_clock.servo, phc_interval);
phc_interval_tp.tv_sec = phc_interval; phc_interval_tp.tv_sec = phc_interval;
phc_interval_tp.tv_nsec = (phc_interval - phc_interval_tp.tv_sec) * 1e9; phc_interval_tp.tv_nsec = (phc_interval - phc_interval_tp.tv_sec) * 1e9;