summaryrefslogtreecommitdiff
path: root/monitor_nmea0183.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-24 13:39:12 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-24 13:39:12 -0500
commit0957e01b6047cc31bffec64f1a6426158e6f4d8d (patch)
tree1324f57dbd2c436312af16d0e529fef158e0e6c0 /monitor_nmea0183.c
parente0beddef34daa0690acd468ac6480c5df3bd9d0f (diff)
downloadgpsd-0957e01b6047cc31bffec64f1a6426158e6f4d8d.tar.gz
In gpsmon, refactor so PPS field updates are done by common code.
Diffstat (limited to 'monitor_nmea0183.c')
-rw-r--r--monitor_nmea0183.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/monitor_nmea0183.c b/monitor_nmea0183.c
index 8ba58882..06acfa66 100644
--- a/monitor_nmea0183.c
+++ b/monitor_nmea0183.c
@@ -215,9 +215,6 @@ static void monitor_satlist(WINDOW *win, int y, int x)
static void nmea_update(void)
{
char **fields;
-#ifdef PPS_ENABLE
- struct timedelta_t ppstimes;
-#endif /* PPS_ENABLE */
assert(cookedwin != NULL);
assert(nmeawin != NULL);
@@ -348,25 +345,7 @@ static void nmea_update(void)
}
#ifdef PPS_ENABLE
- /*@-compdef@*/
- /*@-type -noeffect@*/ /* splint is confused about struct timespec */
- if (pps_thread_lastpps(&session, &ppstimes) > 0) {
- /* NOTE: can not use double here due to precision requirements */
- struct timespec timedelta;
- TS_SUB( &timedelta, &ppstimes.clock, &ppstimes.real);
- if ( 86400 < (long)labs(timedelta.tv_sec) ) {
- /* more than one day off, overflow */
- /* need a bigger field to show it */
- (void)mvwprintw(gpgsawin, PPS_LINE, 6, "> 1 day");
- } else {
- char buf[TIMESPEC_LEN];
- timespec_str( &timedelta, buf, sizeof(buf) );
- (void)mvwprintw(gpgsawin, PPS_LINE, 6, "%s", buf);
- }
- (void)wnoutrefresh(gpgsawin);
- }
- /*@+type +noeffect@*/
- /*@+compdef@*/
+ pps_update(gpgsawin, PPS_LINE, 6);
#endif /* PPS_ENABLE */
}