diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-07 06:52:03 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-07 06:52:03 -0500 |
commit | b044ef0e2ff6c6a392d42e69c6cb5ce1d0b5bbda (patch) | |
tree | 36a2a1be1db9e495e43f2d3b091bfb97d93dfcc4 /gpsd.h-tail | |
parent | 2eed866084e4553473f63951d89de4490ce0169c (diff) | |
download | gpsd-b044ef0e2ff6c6a392d42e69c6cb5ce1d0b5bbda.tar.gz |
Revert "Another step in prying ntplib loose. Partly decouple ppsthread.c fom sessions."
Previous approch was a bit too frontal.
Diffstat (limited to 'gpsd.h-tail')
-rw-r--r-- | gpsd.h-tail | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail index 318ebf37..0be3877b 100644 --- a/gpsd.h-tail +++ b/gpsd.h-tail @@ -9,7 +9,6 @@ #include <stdint.h> #include <stdarg.h> #include "gps.h" -#include "ppsthread.h" #include "compiler.h" /* @@ -500,7 +499,12 @@ struct gps_device_t { volatile /*@null@*/ struct shmTime *shm_pps; # endif /* PPS_ENABLE */ #endif /* NTP_ENABLE */ - volatile struct pps_fixtime_t last_fixtime; /* so updates happen once */ + volatile struct { + timestamp_t real; + /* clock must be a timespec as it is in nSec and + * a timestamp_t will lose precision */ + struct timespec clock; /* system clock time when last fix received */ + } last_fixtime; /* so updates happen once */ #ifdef PPS_ENABLE #if defined(HAVE_SYS_TIMEPPS_H) pps_handle_t kernelpps_handle; @@ -509,7 +513,8 @@ struct gps_device_t { /*@null@*/ char *(*thread_report_hook)(struct gps_device_t *, struct timedelta_t *); /*@null@*/ void (*thread_wrap_hook)(struct gps_device_t *); - struct pps_state_t pps_state; + volatile struct timedelta_t ppslast; + volatile int ppscount; #endif /* PPS_ENABLE */ double mag_var; /* magnetic variation in degrees */ bool back_to_nmea; /* back to NMEA on revert? */ @@ -966,8 +971,13 @@ extern void pps_early_init(struct gps_context_t *); extern void timespec_str(const struct timespec *, /*@out@*/char *, int); #define TIMESPEC_LEN 22 /* required length of a timespec buffer */ +#ifdef PPS_ENABLE +extern void pps_thread_stash_fixtime(struct gps_device_t *, + timestamp_t, struct timespec); +#endif /* PPS_ENABLE */ extern void pps_thread_activate(struct gps_device_t *); extern void pps_thread_deactivate(struct gps_device_t *); +extern int pps_thread_lastpps(struct gps_device_t *, struct timedelta_t *); extern void errout_reset(struct gpsd_errout_t *errout); |