telegps-v1.0: Provide one log and append to it
[fw/altos] / src / kernel / ao_log_gps.c
index a5a6358bf7fd9267ddb414357a0f5fbd220eab8d..7643091cdaa759964cdb5b3e7a214eb8c2df55f5 100644 (file)
@@ -26,6 +26,7 @@
 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
@@ -136,3 +137,16 @@ ao_log_flight(uint8_t slot)
                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;
+}