#include <ao_log.h>
#endif
-#if HAS_MPU6000
+#if HAS_MPU6000 || HAS_MPU9250
#include <ao_quaternion.h>
#endif
* number of seconds.
*/
if (ao_config.apogee_lockout) {
- if ((ao_sample_tick - ao_boost_tick) <
+ if ((int16_t) (ao_sample_tick - ao_boost_tick) <
AO_SEC_TO_TICKS(ao_config.apogee_lockout))
break;
}
* the measured altitude reasonably closely; otherwise
* we're probably transsonic.
*/
+#define AO_ERROR_BOUND 100
+
if (ao_speed < 0
#if !HAS_ACCEL
- && (ao_sample_alt >= AO_MAX_BARO_HEIGHT || ao_error_h_sq_avg < 100)
+ && (ao_sample_alt >= AO_MAX_BARO_HEIGHT || ao_error_h_sq_avg < AO_ERROR_BOUND)
#endif
)
{