Add flight number to telemetry stream.
[fw/altos] / src / ao.h
index bc9afcc32ca38430986dce42caefb85c64813f31..f266ac64844e4808033b67263d195080c6c509bc 100644 (file)
--- a/src/ao.h
+++ b/src/ao.h
@@ -107,6 +107,7 @@ ao_start_scheduler(void);
 #define AO_PANIC_LOG           5       /* Failing to read/write log data */
 #define AO_PANIC_CMD           6       /* Too many command sets registered */
 #define AO_PANIC_STDIO         7       /* Too many stdio handlers registered */
+#define AO_PANIC_REBOOT                8       /* Reboot failed */
 
 /* Stop the operating system, beeping and blinking the reason */
 void
@@ -350,6 +351,9 @@ ao_cmd_hex(void);
 void
 ao_cmd_decimal(void);
 
+uint8_t
+ao_match_word(__code char *word);
+
 struct ao_cmds {
        char            cmd;
        void            (*func)(void);
@@ -549,11 +553,11 @@ ao_log_data(struct ao_log_record *log);
 void
 ao_log_flush(void);
 
-/* Log dumping API:
- * ao_log_dump_first() - get first log record
- * ao_log_dump_next()  - get next log record
+/* We record flight numbers in the first record of
+ * the log. Tasks may wait for this to be initialized
+ * by sleeping on this variable.
  */
-extern __xdata struct ao_log_record ao_log_dump;
+extern __xdata uint16_t ao_flight_number;
 
 /* Retrieve first log record for the current flight */
 uint8_t
@@ -784,10 +788,11 @@ ao_gps_report_init(void);
  */
 
 #define AO_MAX_CALLSIGN                8
-#define AO_TELEMETRY_VERSION   1
+#define AO_TELEMETRY_VERSION   2
 
 struct ao_telemetry {
        uint8_t                 addr;
+       uint16_t                flight;
        uint8_t                 flight_state;
        int16_t                 flight_accel;
        int16_t                 ground_accel;