projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Eliminate height requirement for coast detect
[fw/altos]
/
src
/
kernel
/
ao_flight.c
diff --git
a/src/kernel/ao_flight.c
b/src/kernel/ao_flight.c
index cb02c4549ee20564981f8fafa7c2072b1bdd1b65..7b3cb9fa6411055667c4fb82844c6582029a4c1b 100644
(file)
--- a/
src/kernel/ao_flight.c
+++ b/
src/kernel/ao_flight.c
@@
-233,7
+233,7
@@
ao_flight(void)
* deceleration, or by waiting until the maximum burn duration
* (15 seconds) has past.
*/
* deceleration, or by waiting until the maximum burn duration
* (15 seconds) has past.
*/
- if ((ao_accel < AO_MSS_TO_ACCEL(-2.5)
&& ao_height > AO_M_TO_HEIGHT(100)
) ||
+ if ((ao_accel < AO_MSS_TO_ACCEL(-2.5)) ||
(int16_t) (ao_sample_tick - ao_boost_tick) > BOOST_TICKS_MAX)
{
#if HAS_ACCEL
(int16_t) (ao_sample_tick - ao_boost_tick) > BOOST_TICKS_MAX)
{
#if HAS_ACCEL
@@
-310,7
+310,7
@@
ao_flight(void)
#if HAS_ACCEL
else {
check_re_boost:
#if HAS_ACCEL
else {
check_re_boost:
- ao_coast_avg_accel = ao_coast_avg_accel
- (ao_coast_avg_accel >> 6) + (ao_accel >> 6
);
+ ao_coast_avg_accel = ao_coast_avg_accel
+ ((ao_accel - ao_coast_avg_accel) >> 5
);
if (ao_coast_avg_accel > AO_MSS_TO_ACCEL(20)) {
ao_boost_tick = ao_sample_tick;
ao_flight_state = ao_flight_boost;
if (ao_coast_avg_accel > AO_MSS_TO_ACCEL(20)) {
ao_boost_tick = ao_sample_tick;
ao_flight_state = ao_flight_boost;