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>
uint8_t year;
uint8_t month;
uint8_t day;
uint8_t year;
uint8_t month;
uint8_t day;
} gps_date;
struct {
uint16_t d0;
} gps_date;
struct {
uint16_t d0;
};
/* Write a record to the eeprom log */
};
/* Write a record to the eeprom log */
ao_log_data(__xdata struct ao_log_record *log) __reentrant;
/* Flush the log */
ao_log_data(__xdata struct ao_log_record *log) __reentrant;
/* Flush the log */
gps_log.u.gps_altitude.unused = 0xffff;
ao_log_data(&gps_log);
if (!date_reported && (gps_data.flags & AO_GPS_DATE_VALID)) {
gps_log.u.gps_altitude.unused = 0xffff;
ao_log_data(&gps_log);
if (!date_reported && (gps_data.flags & AO_GPS_DATE_VALID)) {
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;
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;
+ gps_log.u.gps_date.extra = 0;
+ date_reported = ao_log_data(&gps_log);
ao_log_data(__xdata struct ao_log_record *log) __reentrant
{
ao_log_data(__xdata struct ao_log_record *log) __reentrant
{
/* set checksum */
log->csum = 0;
log->csum = ao_log_csum((__xdata uint8_t *) log);
ao_mutex_get(&ao_log_mutex); {
if (ao_log_running) {
/* set checksum */
log->csum = 0;
log->csum = ao_log_csum((__xdata uint8_t *) log);
ao_mutex_get(&ao_log_mutex); {
if (ao_log_running) {
ao_ee_write(ao_log_current_pos,
(uint8_t *) log,
sizeof (struct ao_log_record));
ao_ee_write(ao_log_current_pos,
(uint8_t *) log,
sizeof (struct ao_log_record));
ao_log_running = 0;
}
} ao_mutex_put(&ao_log_mutex);
ao_log_running = 0;
}
} ao_mutex_put(&ao_log_mutex);