summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-02-02 18:27:02 -0800
committerGary E. Miller <gem@rellim.com>2015-02-02 18:27:02 -0800
commit56b101e5b96851dba5240478c79bf8e892f424c9 (patch)
tree72979d4c5c5652af8639c2896a8be2c7578c96c9
parent4e08dfa2ee065912fa64c3fea606a666d5813cde (diff)
downloadgpsd-56b101e5b96851dba5240478c79bf8e892f424c9.tar.gz
Add debugging for lat_fixtime_real getting clobbered.
-rw-r--r--ppsthread.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/ppsthread.c b/ppsthread.c
index 1b3e525b..318a23d5 100644
--- a/ppsthread.c
+++ b/ppsthread.c
@@ -325,6 +325,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
session->gpsdata.dev.path, errno, strerror(errno));
break;
}
+ /* start of time critical section */
gpsd_report(&session->context->errout, LOG_PROG,
"PPS ioctl(TIOCMIWAIT) on %s succeeded\n",
session->gpsdata.dev.path);
@@ -353,7 +354,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
TVTOTS( &clock_ts, &clock_tv);
#endif /* HAVE_CLOCK_GETTIME */
/*@+noeffect@*/
-
+
/* got the edge, got the time just after the edge, now quickly
* get the edge state */
/*@ +ignoresigns */
@@ -364,6 +365,15 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
break;
}
/*@ -ignoresigns */
+ /* end of time critical section */
+
+ if ( isnan( last_fixtime_real ) ) {
+ gpsd_report(&session->context->errout, LOG_ERROR,
+ "PPS last_fixtime_real is NAN\n");
+ /* this should never happen, but it does. */
+ last_fixtime_real = 0.0;
+ }
+
/* mask for monitored lines */
state &= PPS_LINE_TIOC;
@@ -602,6 +612,8 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
#if defined(HAVE_SYS_TIMEPPS_H)
if ( 0 <= session->kernelpps_handle && ok_kpps) {
/* use KPPS time */
+ gpsd_report(&session->context->errout, LOG_RAW,
+ "KPPS using edge %d", edge_kpps );
/* pick the right edge */
if ( edge_kpps ) {
clock_ts = pi.assert_timestamp; /* structure copy */