+#ifdef AO_LED_GPS_LOCK
+
+static struct ao_task ao_gps_lock_task;
+
+static void
+ao_gps_lock(void)
+{
+ for (;;) {
+ if ((gps_data.flags & (AO_GPS_VALID|AO_GPS_COURSE_VALID)) ==
+ (AO_GPS_VALID|AO_GPS_COURSE_VALID))
+ {
+ ao_led_for(AO_LED_GPS_LOCK, AO_MS_TO_TICKS(20));
+ }
+ ao_delay(AO_SEC_TO_TICKS(3));
+ }
+}
+#endif
+
+
+static uint8_t erasing_current;
+
+void
+ao_tracker_erase_start(uint16_t flight)
+{
+ erasing_current = flight == ao_flight_number;
+ if (erasing_current) {
+ ao_mutex_get(&tracker_mutex);
+ ao_log_stop();
+ if (++ao_flight_number == 0)
+ ao_flight_number = 1;
+ }
+}
+
+void
+ao_tracker_erase_end(void)
+{
+ if (erasing_current) {
+ log_started = ao_log_scan();
+ ao_mutex_put(&tracker_mutex);
+ }
+}
+