summaryrefslogtreecommitdiff
path: root/src/ao_gps_report.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-02-13 16:42:27 -0800
committerKeith Packard <keithp@keithp.com>2010-02-13 16:42:27 -0800
commit876e9a10b9096ead85fbe08ec9a6a0329cf7cbd4 (patch)
treed87d21c73a2b91f094207fb8b7d14374c66f9e84 /src/ao_gps_report.c
parentc83615567b4567f3dc45a7f7b894943b45fbb65c (diff)
Log GPS data on pad after boost detect.
This wakes up the two GPS reporting tasks and gets them to report out any existing GPS data to the log file. To make sure the timestamps in that GPS data are accurate, this also records GPS time on receipt of the GPS data instead of when that is logged. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_gps_report.c')
-rw-r--r--src/ao_gps_report.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ao_gps_report.c b/src/ao_gps_report.c
index e3e27523..cceb79ff 100644
--- a/src/ao_gps_report.c
+++ b/src/ao_gps_report.c
@@ -33,7 +33,7 @@ ao_gps_report(void)
if (!(gps_data.flags & AO_GPS_VALID))
continue;
- gps_log.tick = ao_time();
+ gps_log.tick = ao_gps_tick;
gps_log.type = AO_LOG_GPS_TIME;
gps_log.u.gps_time.hour = gps_data.hour;
gps_log.u.gps_time.minute = gps_data.minute;
@@ -71,13 +71,13 @@ ao_gps_tracking_report(void)
for (;;) {
ao_sleep(&ao_gps_tracking_data);
ao_mutex_get(&ao_gps_mutex);
+ gps_log.tick = ao_gps_tick;
memcpy(&gps_tracking_data, &ao_gps_tracking_data, sizeof (struct ao_gps_tracking_data));
ao_mutex_put(&ao_gps_mutex);
if (!(n = gps_tracking_data.channels))
continue;
- gps_log.tick = ao_time();
gps_log.type = AO_LOG_GPS_SAT;
for (c = 0; c < n; c++)
if ((gps_log.u.gps_sat.svid = gps_tracking_data.sats[c].svid))