projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/kernel: MPU9250 support
[fw/altos]
/
src
/
kernel
/
ao_flight.c
diff --git
a/src/kernel/ao_flight.c
b/src/kernel/ao_flight.c
index 50f2b68f998f3df1c7960bfb64ffb6153e15de6f..cb02c4549ee20564981f8fafa7c2072b1bdd1b65 100644
(file)
--- a/
src/kernel/ao_flight.c
+++ b/
src/kernel/ao_flight.c
@@
-21,7
+21,7
@@
#include <ao_log.h>
#endif
#include <ao_log.h>
#endif
-#if HAS_MPU6000
+#if HAS_MPU6000
|| HAS_MPU9250
#include <ao_quaternion.h>
#endif
#include <ao_quaternion.h>
#endif
@@
-269,7
+269,7
@@
ao_flight(void)
* number of seconds.
*/
if (ao_config.apogee_lockout) {
* 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;
}
AO_SEC_TO_TICKS(ao_config.apogee_lockout))
break;
}
@@
-282,9
+282,11
@@
ao_flight(void)
* the measured altitude reasonably closely; otherwise
* we're probably transsonic.
*/
* the measured altitude reasonably closely; otherwise
* we're probably transsonic.
*/
+#define AO_ERROR_BOUND 100
+
if (ao_speed < 0
#if !HAS_ACCEL
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
)
{
#endif
)
{