summaryrefslogtreecommitdiff
path: root/src/ao_gps_report.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-08-26 23:37:29 -0700
committerKeith Packard <keithp@keithp.com>2010-08-26 23:37:29 -0700
commit68b2b66d7574dfd0bd5e3571b8ffad32ca5d2b73 (patch)
tree23e144c57c6f2193cb71feeb4848633a2853d44f /src/ao_gps_report.c
parentaa6c27df5db6bdae59d00affccb891854a6caa18 (diff)
altos: mark gps date written only after it gets into eeprom
Data logging doesn't start until boost detect occurs. As the GPS date is only logged once, if that happens before logging is written to the flash, then the GPS date will never get saved. 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 cceb79ff..7abc93f5 100644
--- a/src/ao_gps_report.c
+++ b/src/ao_gps_report.c
@@ -51,12 +51,12 @@ ao_gps_report(void)
gps_log.u.gps_altitude.unused = 0xffff;
ao_log_data(&gps_log);
if (!date_reported && (gps_data.flags & AO_GPS_DATE_VALID)) {
- date_reported = 1;
gps_log.type = AO_LOG_GPS_DATE;
gps_log.u.gps_date.year = gps_data.year;
gps_log.u.gps_date.month = gps_data.month;
gps_log.u.gps_date.day = gps_data.day;
- ao_log_data(&gps_log);
+ gps_log.u.gps_date.extra = 0;
+ date_reported = ao_log_data(&gps_log);
}
}
}