summaryrefslogtreecommitdiff
path: root/ntpshm.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2013-10-16 19:00:01 -0700
committerGary E. Miller <gem@rellim.com>2013-10-16 19:00:01 -0700
commitcb9687b22937fa5758e255f911b37f6e8e6563fe (patch)
treec54a0a9172783be4cd1cefd7e0f5926180620e73 /ntpshm.c
parent0a876d5c5a47c98612956913517df99e4c3410cc (diff)
downloadgpsd-cb9687b22937fa5758e255f911b37f6e8e6563fe.tar.gz
Rename a KPPS variable so all KPPS vars end in _kpps.
Diffstat (limited to 'ntpshm.c')
-rw-r--r--ntpshm.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ntpshm.c b/ntpshm.c
index 00d6d321..c0c7570f 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -567,7 +567,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
struct timeval pulse[2] = { {0, 0}, {0, 0} };
#endif /* TIOCMIWAIT */
#if defined(HAVE_SYS_TIMEPPS_H)
- int kpps_edge = 0; /* 0 = clear edge, 1 = assert edge */
+ int edge_kpps = 0; /* 0 = clear edge, 1 = assert edge */
int cycle_kpps, duration_kpps;
struct timespec pulse_kpps[2] = { {0, 0}, {0, 0} };
struct timespec tv_kpps;
@@ -705,16 +705,16 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
} else {
// find the last edge
if ( pi.assert_timestamp.tv_sec > pi.clear_timestamp.tv_sec ) {
- kpps_edge = 1;
+ edge_kpps = 1;
tv_kpps = pi.assert_timestamp;
} else if ( pi.assert_timestamp.tv_sec < pi.clear_timestamp.tv_sec ) {
- kpps_edge = 0;
+ edge_kpps = 0;
tv_kpps = pi.clear_timestamp;
} else if ( pi.assert_timestamp.tv_nsec > pi.clear_timestamp.tv_nsec ) {
- kpps_edge = 1;
+ edge_kpps = 1;
tv_kpps = pi.assert_timestamp;
} else {
- kpps_edge = 0;
+ edge_kpps = 0;
tv_kpps = pi.clear_timestamp;
}
gpsd_report(session->context->debug, LOG_PROG,
@@ -728,11 +728,11 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
pi.clear_sequence);
gpsd_report(session->context->debug, LOG_PROG,
"KPPS data: using %s\n",
- kpps_edge ? "assert" : "clear");
+ edge_kpps ? "assert" : "clear");
#define timediff_kpps(x, y) (int)((x.tv_sec-y.tv_sec)*1000000+((x.tv_nsec-y.tv_nsec)/1000))
- cycle_kpps = timediff_kpps(tv_kpps, pulse_kpps[kpps_edge]);
- duration_kpps = timediff_kpps(tv_kpps, pulse_kpps[(int)(kpps_edge == 0)]);
+ cycle_kpps = timediff_kpps(tv_kpps, pulse_kpps[edge_kpps]);
+ duration_kpps = timediff_kpps(tv_kpps, pulse_kpps[(int)(edge_kpps == 0)]);
if ( 3000000 < duration_kpps ) {
// invisible pulse
duration_kpps = 0;
@@ -743,7 +743,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
cycle_kpps, duration_kpps,
(unsigned long)tv_kpps.tv_sec,
(unsigned long)tv_kpps.tv_nsec);
- pulse_kpps[kpps_edge] = tv_kpps;
+ pulse_kpps[edge_kpps] = tv_kpps;
ok = true;
log = "KPPS";
}
@@ -900,7 +900,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
#if defined(HAVE_SYS_TIMEPPS_H)
if ( 0 <= session->kernelpps_handle) {
/* pick the right edge */
- if ( kpps_edge ) {
+ if ( edge_kpps ) {
ts = pi.assert_timestamp; /* structure copy */
} else {
ts = pi.clear_timestamp; /* structure copy */