summaryrefslogtreecommitdiff
path: root/ppsthread.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-07 05:50:01 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-03-07 05:50:01 -0500
commit61c16bebe1a56cb1c211733b92474bf866eba87d (patch)
tree8b078214f79fae9b8f9bdf608a6f69eebf334801 /ppsthread.h
parente92b21041e00778c72362620ad9d62ffa94613db (diff)
downloadgpsd-61c16bebe1a56cb1c211733b92474bf866eba87d.tar.gz
ntplib extraction requires libgpsd object format bump to 23.
The new struct ppsthread_t isolates the interface to the PPS monitor loop. It will need more members before we're done, including some reporting hooks.
Diffstat (limited to 'ppsthread.h')
-rw-r--r--ppsthread.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/ppsthread.h b/ppsthread.h
index ae7bd886..719239aa 100644
--- a/ppsthread.h
+++ b/ppsthread.h
@@ -22,25 +22,21 @@ struct timedelta_t {
#define HAVE_TIMEDELTA
#endif /* HAVE_TIMEDELTA */
-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 */
+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;
};
#define PPS_THREAD_OK 0
#define PPS_LOCK_ERR -1
#define PPS_UNLOCK_ERR -2
-extern int pps_thread_stash_fixtime(volatile struct pps_fixtime_t *,
+extern int pps_thread_stash_fixtime(volatile struct pps_thread_t *,
timestamp_t, struct timespec);
-extern int pps_thread_lastpps(struct pps_state_t *, struct timedelta_t *);
+extern int pps_thread_lastpps(volatile struct pps_thread_t *,
+ struct timedelta_t *);
#endif /* PPSTHREAD_H */