summaryrefslogtreecommitdiff
path: root/ntpshm.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-19 14:08:39 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-19 14:08:39 -0400
commit4abbf81b5d0af3096b7fb8273ce9762babd16b92 (patch)
tree05daba868f4b3ee21473a587f23a7a6a7f6b7ff6 /ntpshm.c
parent93843896f54f00a180ab16efc202f0f64e6b47e3 (diff)
downloadgpsd-4abbf81b5d0af3096b7fb8273ce9762babd16b92.tar.gz
GPSD assumes 1PPS before ins-stream report. Document this assumption.
Diffstat (limited to 'ntpshm.c')
-rw-r--r--ntpshm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ntpshm.c b/ntpshm.c
index 615f3c42..ceeec5d3 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -357,6 +357,12 @@ static int ntpshm_pps(struct gps_device_t *session, struct timeval *tv)
return -1;
}
+ /*
+ * This innocuous-looking "+ 1" embodies a significant assumption:
+ * that GPSes report time to the second over the serial stream *after*
+ * emitting PPS for the top of second. Thus, when we see PPS our
+ * available report is from the previous cycle and we must increment.
+ */
/*@+relaxtypes@*/
seconds = shmTime->clockTimeStampSec + 1;
offset = fabs((tv->tv_sec - seconds)