Enable the computation of ao_error_h_sq_avg in ao_flight_test even
when an accelerometer is present to allow review of that data.
Signed-off-by: Keith Packard <keithp@keithp.com>
__xdata ao_v_t ao_avg_height;
__pdata ao_v_t ao_error_h;
-#if !HAS_ACCEL
+#if !HAS_ACCEL || AO_FLIGHT_TEST
+#define AO_ERROR_H_SQ_AVG 1
+#endif
+
+#if AO_ERROR_H_SQ_AVG
__pdata ao_v_t ao_error_h_sq_avg;
#endif
static void
ao_kalman_err_height(void)
{
-#if !HAS_ACCEL
+#if AO_ERROR_H_SQ_AVG
ao_v_t e;
#endif
ao_v_t height_distrust;
ao_error_h = ao_sample_height - (ao_v_t) (ao_k_height >> 16);
-#if !HAS_ACCEL
+#if AO_ERROR_H_SQ_AVG
e = ao_error_h;
if (e < 0)
e = -e;
#define AO_MS_TO_TICKS(ms) ((ms) / 10)
#define AO_SEC_TO_TICKS(s) ((s) * 100)
-#define AO_FLIGHT_TEST
+#define AO_FLIGHT_TEST 1
int ao_flight_debug;
static struct ao_mpu6000_sample ao_ground_mpu6000;
#endif
-#if HAS_ACCEL
-int ao_error_h_sq_avg;
-#endif
-
void
ao_test_exit(void)
{