diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-19 14:08:39 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-19 14:08:39 -0400 |
commit | 4abbf81b5d0af3096b7fb8273ce9762babd16b92 (patch) | |
tree | 05daba868f4b3ee21473a587f23a7a6a7f6b7ff6 /ntpshm.c | |
parent | 93843896f54f00a180ab16efc202f0f64e6b47e3 (diff) | |
download | gpsd-4abbf81b5d0af3096b7fb8273ce9762babd16b92.tar.gz |
GPSD assumes 1PPS before ins-stream report. Document this assumption.
Diffstat (limited to 'ntpshm.c')
-rw-r--r-- | ntpshm.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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) |