diff options
author | Keith Packard <keithp@keithp.com> | 2014-05-27 11:05:02 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-05-27 11:06:49 -0700 |
commit | c674a20432c2cb97e5bc2a3de891f78b9e172fe9 (patch) | |
tree | 233840c888520c39da96f0eee2eca738ab4e9096 /src/kernel/ao_flight.c | |
parent | db08e99361d82de63058d3388823f486e5fc9839 (diff) |
altos: Fake flight code changes in kernel and stm
Redirects data input from local sensors to USB sourced data, leaving
USB enabled when the computer goes into pad mode.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/kernel/ao_flight.c')
-rw-r--r-- | src/kernel/ao_flight.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/kernel/ao_flight.c b/src/kernel/ao_flight.c index 24099347..2b433ee9 100644 --- a/src/kernel/ao_flight.c +++ b/src/kernel/ao_flight.c @@ -36,6 +36,10 @@ #error Please define HAS_USB #endif +#if HAS_FAKE_FLIGHT +#include <ao_fake_flight.h> +#endif + #ifndef HAS_TELEMETRY #define HAS_TELEMETRY HAS_RADIO #endif @@ -130,7 +134,10 @@ ao_flight(void) /* Disable the USB controller in flight mode * to save power */ - ao_usb_disable(); +#if HAS_FAKE_FLIGHT + if (!ao_fake_flight_active) +#endif + ao_usb_disable(); #endif #if !HAS_ACCEL && PACKET_HAS_SLAVE @@ -170,7 +177,6 @@ ao_flight(void) break; case ao_flight_pad: - /* pad to boost: * * barometer: > 20m vertical motion |