summaryrefslogtreecommitdiff
path: root/ao_gps_report.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-04-26 01:37:02 -0700
committerKeith Packard <keithp@keithp.com>2009-04-26 01:37:02 -0700
commit5ed3b1cb52b573db1fee9655a29a0e6dd72f53fe (patch)
tree4a5a2db769ee9f752c970ab7fab1cb507f646f1c /ao_gps_report.c
parent2e737ad00cad5d893b252d8aa9dbff3d9b800731 (diff)
Make sure full log is written and flushed on landing.
The final state change to landing is recorded in the logging thread, so have that turn off logging once it has recorded that state. Then make it go to sleep.
Diffstat (limited to 'ao_gps_report.c')
-rw-r--r--ao_gps_report.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ao_gps_report.c b/ao_gps_report.c
index 494714b6..1b5402a8 100644
--- a/ao_gps_report.c
+++ b/ao_gps_report.c
@@ -29,6 +29,9 @@ ao_gps_report(void)
memcpy(&gps_data, &ao_gps_data, sizeof (struct ao_gps_data));
ao_mutex_put(&ao_gps_mutex);
+ if (!(gps_data.flags & AO_GPS_VALID))
+ continue;
+
gps_log.tick = ao_time();
gps_log.type = AO_LOG_GPS_TIME;
gps_log.u.gps_time.hour = gps_data.hour;