+/*
+ * Above this height, the baro sensor doesn't work
+ */
+#define AO_MAX_BARO_HEIGHT 12000
+
+/*
+ * Above this speed, baro measurements are unreliable
+ */
+#define AO_MAX_BARO_SPEED 300
+
+static void
+ao_kalman_predict(void)
+{
+#ifdef AO_FLIGHT_TEST
+ if (ao_flight_tick - ao_flight_prev_tick > 5) {
+ ao_k_height += ((int32_t) ao_speed * AO_K_STEP_10 +
+ (int32_t) ao_accel * AO_K_STEP_2_2_10) >> 4;
+ ao_k_speed += (int32_t) ao_accel * AO_K_STEP_10;
+
+ return;
+ }
+#endif
+ ao_k_height += ((int32_t) ao_speed * AO_K_STEP_100 +
+ (int32_t) ao_accel * AO_K_STEP_2_2_100) >> 4;
+ ao_k_speed += (int32_t) ao_accel * AO_K_STEP_100;
+}
+
+static __pdata int16_t ao_error_h;
+static __pdata int16_t ao_raw_alt;
+static __pdata int16_t ao_raw_height;
+static __pdata int16_t ao_error_h_sq_avg;
+