From b82cc253da1de5c9beb4674a2e7f855aaea010e5 Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Tue, 5 Apr 2016 14:28:14 -0700 Subject: Bad NMEA time was still leaking, require 3 fixes for time. --- gpsd.c | 2 +- ppsthread.h | 2 ++ timehint.c | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gpsd.c b/gpsd.c index 9d2853d3..2381e17c 100644 --- a/gpsd.c +++ b/gpsd.c @@ -1517,7 +1517,7 @@ static void all_reports(struct gps_device_t *device, gps_mask_t changed) */ if ((changed & TIME_SET) == 0) { //gpsd_log(&context.errout, LOG_PROG, "NTP: No time this packet\n"); - } else if ( 0 >= device->fixcnt && + } else if ( PPS_MIN_FIXES > device->fixcnt && (changed & GOODTIME_IS) == 0) { /* many GPS spew random times until a valid GPS fix */ //gpsd_log(&context.errout, LOG_PROG, "NTP: no fix\n"); diff --git a/ppsthread.h b/ppsthread.h index b37e739c..7c3c5d65 100644 --- a/ppsthread.h +++ b/ppsthread.h @@ -16,6 +16,8 @@ struct timedelta_t { }; #endif /* TIMEDELTA_DEFINED */ +#define PPS_MIN_FIXES 3 /* # fixes to wait for before shipping NTP time */ + /* * Set context, devicefd, and devicename at initialization time, before * you call pps_thread_activate(). The context pointer can be used to diff --git a/timehint.c b/timehint.c index c224d767..b37ea78b 100644 --- a/timehint.c +++ b/timehint.c @@ -105,8 +105,6 @@ * garbage-collects them when they have no attached processes. */ -#define PPS_MIN_FIXES 3 /* # fixes to wait for before shipping PPS */ - static volatile struct shmTime *getShmTime(struct gps_context_t *context, int unit) { int shmid; -- cgit v1.2.1