summaryrefslogtreecommitdiff
path: root/ppsthread.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2013-11-29 23:32:59 -0800
committerGary E. Miller <gem@rellim.com>2013-11-29 23:32:59 -0800
commit99fca6cccee2aed7f886993a33e33464ac9339b2 (patch)
treef8ee943a1d1953252e53a95009d337be1df75ab1 /ppsthread.c
parent1488d63f65fcf6466e36005e4494c3bb707855e4 (diff)
downloadgpsd-99fca6cccee2aed7f886993a33e33464ac9339b2.tar.gz
2nd try at rejecting negative cycle times.
Diffstat (limited to 'ppsthread.c')
-rw-r--r--ppsthread.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ppsthread.c b/ppsthread.c
index c5f6a396..7f91191d 100644
--- a/ppsthread.c
+++ b/ppsthread.c
@@ -424,10 +424,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
/*@ -boolint @*/
if (state == laststate) {
/* some pulses may be so short that state never changes */
- if (0 > cycle ) {
- gpsd_report(session->context->debug, LOG_WARN,
- "PPS rejecting negative cycle\n");
- } else if (999000 < cycle && 1001000 > cycle) {
+ if (999000 < cycle && 1001000 > cycle) {
duration = 0;
unchanged = 0;
gpsd_report(session->context->debug, LOG_RAW,
@@ -484,7 +481,9 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
*/
log = "Unknown error";
- if (199000 > cycle) {
+ if ( 0 > cycle ) {
+ log = "Rejecting negative cycle\n";
+ } else if (199000 > cycle) {
// too short to even be a 5Hz pulse
log = "Too short for 5Hz\n";
} else if (201000 > cycle) {