diff options
author | Fred Wright <fw@fwright.net> | 2016-12-22 19:47:25 -0800 |
---|---|---|
committer | Fred Wright <fw@fwright.net> | 2016-12-23 13:24:12 -0800 |
commit | e2471ddd5934d24dff6802bdbe4b38e83878cc01 (patch) | |
tree | 0482bdba58ea4ed5a890e5a018f54ec4ebb25c4c /ppsthread.h | |
parent | 79c69b2b12e5f8ee3aa3f50b8886a0a7bbdd73f7 (diff) | |
download | gpsd-e2471ddd5934d24dff6802bdbe4b38e83878cc01.tar.gz |
Adds Linux "fake PPS" detection and avoidance.
If the Linux kernel is built with CONFIG_PPS_CLIENT_KTIMER=y, then a
synthetic PPS source is added to allow testing without a real PPS
source. However, this source doesn't even run at exactly 1Hz, so any
attempt to use it for real time synchronization is disastrous.
To make matters worse, this is usually the first PPS driver
configured, causing it to appear as /dev/pps0, which is the implied
PPS device used by the "Magic HAT" kludge.
This change adds detection for the fake source (based on its name),
both to provide a warning if it is configured explicitly, and to skip
over it when applying the "Magic HAT" kludge.
TESTED:
Tested both gpsmon and gpsd on a Beaglebone Black with added symlinks
for testing "Magic HAT". Did this with kernels with and without the
KTIMER enabled. Verified that the proper PPS device is selected by
"Magic HAT", and that a warning is generated when expected.
Diffstat (limited to 'ppsthread.h')
-rw-r--r-- | ppsthread.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ppsthread.h b/ppsthread.h index b37e739c..3d5f696e 100644 --- a/ppsthread.h +++ b/ppsthread.h @@ -53,5 +53,7 @@ extern void pps_thread_fixin(volatile struct pps_thread_t *, volatile struct timedelta_t *); extern int pps_thread_ppsout(volatile struct pps_thread_t *, volatile struct timedelta_t *); +int pps_check_fake(const char *); +char *pps_get_first(void); #endif /* PPSTHREAD_H */ |