diff options
author | Gary E. Miller <gem@rellim.com> | 2015-02-11 19:51:36 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2015-02-11 19:51:36 -0800 |
commit | 80d869d92dceeab173525f80a5f973849d68433d (patch) | |
tree | 9db2653a31dafc3b4375ad97e931d8df71d915ad /gpsmon.c | |
parent | 927ce93c49f8a9e84433141357e3602ada077850 (diff) | |
download | gpsd-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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 */ } |