Force idle mode by shorting the SPI clock to ground at boot time.
[fw/altos] / src / ao.h
index 287c912d17e492f6a139197db5e9aa060ad06174..2c6eb2b91180d254818ca2553849a0b2cde95a90 100644 (file)
--- a/src/ao.h
+++ b/src/ao.h
@@ -108,6 +108,7 @@ ao_start_scheduler(void);
 #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 */
+#define AO_PANIC_FLASH         9       /* Invalid flash part (or wrong blocksize) */
 
 /* Stop the operating system, beeping and blinking the reason */
 void
@@ -617,6 +618,7 @@ extern __pdata int16_t                      ao_ground_pres;
 extern __pdata int16_t                 ao_ground_accel;
 extern __pdata int16_t                 ao_min_pres;
 extern __pdata uint16_t                        ao_launch_time;
+extern __xdata uint8_t                 ao_flight_force_idle;
 
 /* Flight thread */
 void
@@ -835,6 +837,11 @@ extern __xdata uint8_t ao_radio_mutex;
 void
 ao_radio_general_isr(void) interrupt 16;
 
+void
+ao_radio_get(void);
+
+#define ao_radio_put() ao_mutex_put(&ao_radio_mutex)
+
 void
 ao_radio_set_telemetry(void);
 
@@ -938,17 +945,18 @@ ao_igniter_init(void);
  */
 
 #define AO_CONFIG_MAJOR        1
-#define AO_CONFIG_MINOR        2
+#define AO_CONFIG_MINOR        3
 
 struct ao_config {
        uint8_t         major;
        uint8_t         minor;
        uint16_t        main_deploy;
-       int16_t         accel_plus_g;
+       int16_t         accel_plus_g;           /* changed for minor version 2 */
        uint8_t         radio_channel;
        char            callsign[AO_MAX_CALLSIGN + 1];
-       uint8_t         apogee_delay;
-       int16_t         accel_minus_g;
+       uint8_t         apogee_delay;           /* minor version 1 */
+       int16_t         accel_minus_g;          /* minor version 2 */
+       uint32_t        radio_cal;              /* minor version 3 */
 };
 
 extern __xdata struct ao_config ao_config;