*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
#include <ao_distance.h>
#include <ao_tracker.h>
-static __xdata uint8_t ao_log_mutex;
static __xdata struct ao_log_gps log;
__code uint8_t ao_log_format = AO_LOG_FORMAT_TELEGPS;
+__code uint8_t ao_log_size = sizeof (struct ao_log_gps);
static uint8_t
ao_log_csum(__xdata uint8_t *b) __reentrant
log.type = AO_LOG_GPS_TIME;
log.u.gps.latitude = gps_data->latitude;
log.u.gps.longitude = gps_data->longitude;
- log.u.gps.altitude = gps_data->altitude;
+ log.u.gps.altitude_low = gps_data->altitude_low;
+ log.u.gps.altitude_high = gps_data->altitude_high;
log.u.gps.hour = gps_data->hour;
log.u.gps.minute = gps_data->minute;
return log.u.flight.flight;
return 0;
}
+
+uint8_t
+ao_log_check(uint32_t pos)
+{
+ if (!ao_storage_read(pos,
+ &log,
+ sizeof (struct ao_log_gps)))
+ return 0;
+
+ if (ao_log_dump_check_data())
+ return 1;
+ return 0;
+}