From 80d869d92dceeab173525f80a5f973849d68433d Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Wed, 11 Feb 2015 19:51:36 -0800 Subject: Stop calling ntpshhm_latch() more than once a second in gpsmon. Now the gpsmon hardware mode call to ntpshm_latch() looks more like the one in gpsd. --- gpsmon.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gpsmon.c') diff --git a/gpsmon.c b/gpsmon.c index 7fb80b38..52e6fd57 100644 --- a/gpsmon.c +++ b/gpsmon.c @@ -745,8 +745,13 @@ static void gpsmon_hook(struct gps_device_t *device, gps_mask_t changed UNUSED) report_unlock(); #ifdef NTPSHM_ENABLE - /* Update the last fix time seen for PPS if we've actually seen one. */ - if (isnan(device->newdata.time)==0) + /* Update the last fix time seen for PPS if we've actually seen one, + * and it is a new second. */ + if ( 0 != isnan(device->newdata.time)) { + // "NTP: bad new time + } else if (device->newdata.time == device->last_fixtime.real) { + // "NTP: Not a new time + } else ntpshm_latch(device, &td); #endif /* NTPSHM_ENABLE */ } -- cgit v1.2.1