summaryrefslogtreecommitdiff
path: root/ppsthread.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-04-01 10:22:24 -0700
committerGary E. Miller <gem@rellim.com>2015-04-01 11:04:36 -0700
commit89e84cb61eebfd104e59ba937b03944ce27ed782 (patch)
tree1e839b0f306abde7109e4a1ea78eb50535b4c1d3 /ppsthread.c
parent7c732dfafc67773b02984cdfbab4779336af1bd4 (diff)
downloadgpsd-89e84cb61eebfd104e59ba937b03944ce27ed782.tar.gz
Move the calculation back into "Stage Three: Calculation"
This cancels the change that broke a lot of logging.
Diffstat (limited to 'ppsthread.c')
-rw-r--r--ppsthread.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ppsthread.c b/ppsthread.c
index 3425dcda..fe208439 100644
--- a/ppsthread.c
+++ b/ppsthread.c
@@ -1056,7 +1056,13 @@ static void *gpsd_ppsmonitor(void *arg)
* line assertion by about 10 mSec!
*/
- ppstimes.real.tv_sec = (time_t)last_fixtime.real.tv_sec;
+ /*
+ * We get the time of the last fix recorded before the PPS came in,
+ * which is for the previous cycle. Only works for integral cycle
+ * times, but more than 1Hz is pointless.
+ */
+
+ ppstimes.real.tv_sec = (time_t)last_fixtime.real.tv_sec + 1;
ppstimes.real.tv_nsec = 0; /* need to be fixed for 5Hz */
ppstimes.clock = clock_ts;