summaryrefslogtreecommitdiff
path: root/gpsmon.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-02-11 19:51:36 -0800
committerGary E. Miller <gem@rellim.com>2015-02-11 19:51:36 -0800
commit80d869d92dceeab173525f80a5f973849d68433d (patch)
tree9db2653a31dafc3b4375ad97e931d8df71d915ad /gpsmon.c
parent927ce93c49f8a9e84433141357e3602ada077850 (diff)
downloadgpsd-80d869d92dceeab173525f80a5f973849d68433d.tar.gz
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.
Diffstat (limited to 'gpsmon.c')
-rw-r--r--gpsmon.c9
1 files changed, 7 insertions, 2 deletions
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 */
}