summaryrefslogtreecommitdiff
path: root/ppsthread.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-07 06:50:49 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-03-07 06:50:49 -0500
commit2eed866084e4553473f63951d89de4490ce0169c (patch)
tree2871a2dda9955daabb8efab913cd3b13684cb8f8 /ppsthread.h
parent61c16bebe1a56cb1c211733b92474bf866eba87d (diff)
downloadgpsd-2eed866084e4553473f63951d89de4490ce0169c.tar.gz
Revert "ntplib extraction requires libgpsd object format bump to 23."
We need to sneak up on this in a more subtle way.
Diffstat (limited to 'ppsthread.h')
-rw-r--r--ppsthread.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/ppsthread.h b/ppsthread.h
index 719239aa..ae7bd886 100644
--- a/ppsthread.h
+++ b/ppsthread.h
@@ -22,21 +22,25 @@ struct timedelta_t {
#define HAVE_TIMEDELTA
#endif /* HAVE_TIMEDELTA */
-struct pps_thread_t {
- timestamp_t fixin_real;
- struct timespec fixin_clock; /* system clock time when last fix received */
- struct timedelta_t ppsout_last;
- int ppsout_count;
+struct pps_state_t {
+ volatile struct timedelta_t ppslast;
+ volatile int ppscount;
+};
+
+struct pps_fixtime_t {
+ 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 */
};
#define PPS_THREAD_OK 0
#define PPS_LOCK_ERR -1
#define PPS_UNLOCK_ERR -2
-extern int pps_thread_stash_fixtime(volatile struct pps_thread_t *,
+extern int pps_thread_stash_fixtime(volatile struct pps_fixtime_t *,
timestamp_t, struct timespec);
-extern int pps_thread_lastpps(volatile struct pps_thread_t *,
- struct timedelta_t *);
+extern int pps_thread_lastpps(struct pps_state_t *, struct timedelta_t *);
#endif /* PPSTHREAD_H */