diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-02-24 13:39:12 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-02-24 13:39:12 -0500 |
commit | 0957e01b6047cc31bffec64f1a6426158e6f4d8d (patch) | |
tree | 1324f57dbd2c436312af16d0e529fef158e0e6c0 /monitor_ubx.c | |
parent | e0beddef34daa0690acd468ac6480c5df3bd9d0f (diff) | |
download | gpsd-0957e01b6047cc31bffec64f1a6426158e6f4d8d.tar.gz |
In gpsmon, refactor so PPS field updates are done by common code.
Diffstat (limited to 'monitor_ubx.c')
-rw-r--r-- | monitor_ubx.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/monitor_ubx.c b/monitor_ubx.c index 9ad21286..6766524f 100644 --- a/monitor_ubx.c +++ b/monitor_ubx.c @@ -233,9 +233,6 @@ static void ubx_update(void) unsigned char *buf; size_t data_len; unsigned short msgid; -#ifdef PPS_ENABLE - struct timedelta_t ppstimes; -#endif /* PPS_ENABLE */ buf = session.lexer.outbuffer; msgid = (unsigned short)((buf[2] << 8) | buf[3]); @@ -255,25 +252,7 @@ static void ubx_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(ppswin, 1, 6, "> 1 day"); - } else { - char buf2[TIMESPEC_LEN]; - timespec_str( &timedelta, buf2, sizeof(buf2) ); - (void)mvwprintw(ppswin, 1, 6, "%s", buf2); - } - (void)wnoutrefresh(ppswin); - } - /*@+type +noeffect@*/ - /*@+compdef@*/ + pps_update(ppswin, 1, 6); #endif /* PPS_ENABLE */ } |