#define AO_MS_TO_SPEED(ms) ((ao_v_t) ((ms) * 16))
#define AO_MSS_TO_ACCEL(mss) ((ao_v_t) ((mss) * 16))
-extern uint16_t ao_sample_tick; /* time of last data */
+extern AO_TICK_TYPE ao_sample_tick; /* time of last data */
extern uint8_t ao_sample_adc; /* Ring position of last processed sample */
extern uint8_t ao_sample_data; /* Ring position of last processed sample */
extern accel_t ao_accel_2g; /* factory accel calibration */
extern int32_t ao_accel_scale; /* sensor to m/s² conversion */
#endif
-#if HAS_GYRO
+#if HAS_IMU
extern accel_t ao_ground_accel_along;
extern accel_t ao_ground_accel_across;
extern accel_t ao_ground_accel_through;
-extern int32_t ao_ground_pitch; /* * 512 */
-extern int32_t ao_ground_yaw; /* * 512 */
-extern int32_t ao_ground_roll; /* * 512 */
extern accel_t ao_sample_accel_along;
extern accel_t ao_sample_accel_across;
extern accel_t ao_sample_accel_through;
+#endif
+#if HAS_GYRO
+#ifndef HAS_IMU
+#define HAS_IMU 1
+#endif
+extern int32_t ao_ground_pitch; /* * 512 */
+extern int32_t ao_ground_yaw; /* * 512 */
+extern int32_t ao_ground_roll; /* * 512 */
extern gyro_t ao_sample_roll;
extern gyro_t ao_sample_pitch;
extern gyro_t ao_sample_yaw;
extern angle_t ao_sample_orients[AO_NUM_ORIENT];
extern uint8_t ao_sample_orient_pos;
#endif
+#if HAS_MOTOR_PRESSURE
+extern motor_pressure_t ao_ground_motor_pressure;
+extern motor_pressure_t ao_sample_motor_pressure;
+#endif
void ao_sample_init(void);
-/* returns FALSE in preflight mode, TRUE in flight mode */
+/* returns false in preflight mode, true in flight mode */
uint8_t ao_sample(void);
/*
void ao_kalman(void);
+#if !HAS_BARO
+void ao_kalman_reset_accumulate(void);
+#endif
+
#endif /* _AO_SAMPLE_H_ */