Reports special tone along with the continuity checks.
Reports flight 0 in telemetry.
Signed-off-by: Keith Packard <keithp@keithp.com>
uint8_t
ao_log_present(void);
+/* Returns true if there is no more storage space available */
+uint8_t
+ao_log_full(void);
+
/*
* ao_flight.c
*/
return ao_log_max_flight() != 0;
}
+uint8_t
+ao_log_full(void)
+{
+ return ao_log_current_pos == ao_log_end_pos;
+}
+
static __xdata struct ao_task ao_log_task;
void
ao_beep_for(AO_BEEP_LOW, AO_MS_TO_TICKS(20));
}
}
+ if (ao_log_full()) {
+ pause(AO_MS_TO_TICKS(100));
+ c = 2;
+ while (c--) {
+ ao_beep_for(AO_BEEP_LOW, AO_MS_TO_TICKS(100));
+ ao_beep_for(AO_BEEP_MID, AO_MS_TO_TICKS(100));
+ ao_beep_for(AO_BEEP_HIGH, AO_MS_TO_TICKS(100));
+ ao_beep_for(AO_BEEP_MID, AO_MS_TO_TICKS(100));
+ }
+ }
c = 50;
while (c-- && ao_flight_state == ao_flight_pad)
pause(AO_MS_TO_TICKS(100));
ao_sleep(&ao_flight_number);
memcpy(telemetry.callsign, ao_config.callsign, AO_MAX_CALLSIGN);
telemetry.addr = ao_serial_number;
- telemetry.flight = ao_flight_number;
+ telemetry.flight = ao_log_full() ? 0 : ao_flight_number;
telemetry.accel_plus_g = ao_config.accel_plus_g;
telemetry.accel_minus_g = ao_config.accel_minus_g;
ao_rdf_time = ao_time();