projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosui: Rename AltosConfig -> AltosConfigFC
[fw/altos]
/
src
/
kernel
/
ao_log_gps.c
diff --git
a/src/kernel/ao_log_gps.c
b/src/kernel/ao_log_gps.c
index 8bf529f40b862a2eff145338bd2e83346aee08bb..02551169fd46f80a18a8839f5518ef9d63c22da1 100644
(file)
--- a/
src/kernel/ao_log_gps.c
+++ b/
src/kernel/ao_log_gps.c
@@
-3,7
+3,8
@@
*
* 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
*
* 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
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-23,10
+24,10
@@
#include <ao_distance.h>
#include <ao_tracker.h>
#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;
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
static uint8_t
ao_log_csum(__xdata uint8_t *b) __reentrant
@@
-76,7
+77,8
@@
ao_log_gps_data(uint16_t tick, struct ao_telemetry_location *gps_data)
log.type = AO_LOG_GPS_TIME;
log.u.gps.latitude = gps_data->latitude;
log.u.gps.longitude = gps_data->longitude;
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;
log.u.gps.hour = gps_data->hour;
log.u.gps.minute = gps_data->minute;
@@
-136,3
+138,16
@@
ao_log_flight(uint8_t slot)
return log.u.flight.flight;
return 0;
}
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;
+}