+uint8_t
+ao_log_present(void)
+{
+ AO_TICK_TYPE n_samples;
+
+ ao_eeprom_read(N_SAMPLES_OFFSET, &n_samples, sizeof (n_samples));
+
+ return n_samples != 0xffff;
+}
+
+static void
+ao_log_list(void)
+{
+ if (ao_log_present())
+ printf ("flight %d start %x end %x\n",
+ 1,
+ 0, (unsigned) (MAX_LOG_OFFSET >> 8));
+ printf ("done\n");
+}
+
+static void
+ao_log_delete(void)
+{
+ int16_t cmd_flight = 1;
+
+ ao_cmd_white();
+ if (ao_cmd_lex_c == '-') {
+ cmd_flight = -1;
+ ao_cmd_lex();
+ }
+ cmd_flight *= ao_cmd_decimal();
+ if (ao_cmd_status != ao_cmd_success)
+ return;
+
+ /* Look for the flight log matching the requested flight */
+ if (cmd_flight == 1 && ao_log_present()) {
+ ao_log_erase();
+ puts("Erased");
+ return;
+ }
+ printf("No such flight: %d\n", cmd_flight);
+}
+