summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2009-11-12 22:58:48 +0000
committerGary E. Miller <gem@rellim.com>2009-11-12 22:58:48 +0000
commitddf41d03f4005e25208c99b1dbf75feb2b999427 (patch)
treea33d1a3bb333c08c01acad2856cedfb56a837655 /libgpsd_core.c
parent71508647dcf170e7b7a80b234543d5fd2a4098c0 (diff)
downloadgpsd-ddf41d03f4005e25208c99b1dbf75feb2b999427.tar.gz
Never give up totally looking for PPS,...
...but be defensive if the CD/RI seems just flapping.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index b7580503..87f7d861 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -150,12 +150,12 @@ static /*@null@*/void *gpsd_ppsmonitor(void *arg)
if (state == laststate) {
/* some pulses may be so short that state never changes */
- if ( 999900 < cycle && 1000100 > cycle ) {
+ if ( 999000 < cycle && 1001000 > cycle ) {
duration = 0;
unchanged = 0;
} else if (++unchanged == 10) {
- gpsd_report(LOG_WARN, "TIOCMIWAIT returns unchanged state, ppsmonitor terminates\n");
- break;
+ gpsd_report(LOG_WARN, "TIOCMIWAIT returns unchanged state, ppsmonitor sleeps 10\n");
+ sleep(10);
}
} else {
gpsd_report(LOG_RAW, "pps-detect (%s) on %s changed to %d\n",