diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-02-24 06:48:33 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-02-24 06:48:33 -0500 |
commit | 34df72ab62d8b00e1ba3b4c71559dd381d9540d6 (patch) | |
tree | 7199e0f316f4fd3391eb215a1308fdd497b3ea56 /monitor_nmea0183.c | |
parent | 2816615018ca0c329246bf10fe7ec7e08e82bcf0 (diff) | |
download | gpsd-34df72ab62d8b00e1ba3b4c71559dd381d9540d6.tar.gz |
TOFF display in gpsmon.
Diffstat (limited to 'monitor_nmea0183.c')
-rw-r--r-- | monitor_nmea0183.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/monitor_nmea0183.c b/monitor_nmea0183.c index cf79f23b..39eae9d7 100644 --- a/monitor_nmea0183.c +++ b/monitor_nmea0183.c @@ -98,11 +98,14 @@ static bool nmea_initialize(void) (void)mvwprintw(gpgsawin, SATS_LINE, SATS_COL, "Sats: "); #define DOP_LINE 2 (void)mvwprintw(gpgsawin, DOP_LINE, 1, "DOP: H= V= P="); -#define PPS_LINE 4 - (void)mvwprintw(gpgsawin, PPS_LINE, 1, "PPS: "); #define TOFF_LINE 3 (void)mvwprintw(gpgsawin, TOFF_LINE, 1, "TOFF: "); #ifndef PPS_ENABLE + (void)mvwaddstr(gpgsawin, TOS_LINE, 7, "N/A"); +#endif /* PPS_ENABLE */ +#define PPS_LINE 4 + (void)mvwprintw(gpgsawin, PPS_LINE, 1, "PPS: "); +#ifndef PPS_ENABLE (void)mvwaddstr(gpgsawin, PPS_LINE, 6, "N/A"); #endif /* PPS_ENABLE */ (void)mvwprintw(gpgsawin, 5, 9, " GSA + PPS "); @@ -316,13 +319,14 @@ static void nmea_update(void) monitor_fixframe(gpgsawin); } +#ifdef NTP_ENABLE /*@-compdef@*/ /*@-type -noeffect@*/ /* splint is confused about struct timespec */ - if ((session.gpsdata.set & TOFF_SET) != 0) { + if (time_offset.real.tv_sec != 0) + { /* NOTE: can not use double here due to precision requirements */ struct timespec timedelta; - TS_SUB(&timedelta, - &session.gpsdata.toff.clock, &session.gpsdata.toff.real); + TS_SUB(&timedelta, &time_offset.clock, &time_offset.real); if ( 86400 < (long)labs(timedelta.tv_sec) ) { /* more than one day off, overflow */ /* need a bigger field to show it */ @@ -332,11 +336,10 @@ static void nmea_update(void) timespec_str( &timedelta, buf, sizeof(buf) ); (void)mvwprintw(gpgsawin, TOFF_LINE, 7, "%s", buf); } - (void)wnoutrefresh(gpgsawin); } /*@+type +noeffect@*/ /*@+compdef@*/ - +#endif /* NTP_ENABLE */ if (strcmp(fields[0], "GPGGA") == 0 || strcmp(fields[0], "GNGGA") == 0 |