summaryrefslogtreecommitdiff
path: root/monitor_nmea.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-12 13:29:42 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-12 13:29:42 -0500
commit9b14a8cd3a90e005c6f5f0708119ad839243d812 (patch)
treeaab33f89d813b41ac885ccfdec8a57bd4f34331e /monitor_nmea.c
parent663a717e9f50795795f546f77d83db014135fa52 (diff)
downloadgpsd-9b14a8cd3a90e005c6f5f0708119ad839243d812.tar.gz
Fix pps=no build.
Diffstat (limited to 'monitor_nmea.c')
-rw-r--r--monitor_nmea.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/monitor_nmea.c b/monitor_nmea.c
index 4f7d706c..d08f9522 100644
--- a/monitor_nmea.c
+++ b/monitor_nmea.c
@@ -174,8 +174,9 @@ static void cooked_pvt(void)
static void nmea_update(void)
{
char **fields;
+#ifdef PPS_ENABLE
struct timedrift_t drift;
- double timedelta;
+#endif /* PPS_ENABLE */
assert(cookedwin != NULL);
assert(nmeawin != NULL);
@@ -316,12 +317,15 @@ static void nmea_update(void)
}
}
- pps_thread_lastpps(&session, &drift);
- /*@-type@*/ /* splint is confused about struct timespec */
- timedelta = timespec_diff_ns(drift.real, drift.clock) * 1e-9;
- /*@+type@*/
- (void)mvwprintw(gpgsawin, 4, 13, "%.9f", timedelta);
- wnoutrefresh(gpgsawin);
+#ifdef PPS_ENABLE
+ if (pps_thread_lastpps(&session, &drift) > 0) {
+ /*@-type@*/ /* splint is confused about struct timespec */
+ double timedelta = timespec_diff_ns(drift.real, drift.clock) * 1e-9;
+ /*@+type@*/
+ (void)mvwprintw(gpgsawin, 4, 13, "%.9f", timedelta);
+ wnoutrefresh(gpgsawin);
+ }
+#endif /* PPS_ENABLE */
}
/*@ +globstate +nullpass */