projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Correct incremental rotation computation
[fw/altos]
/
src
/
core
/
ao_flight.c
diff --git
a/src/core/ao_flight.c
b/src/core/ao_flight.c
index 782e22744c434dc28e9356d60708ef728f7e9380..240b348a999e7207963d7274d38a01d0719490a7 100644
(file)
--- a/
src/core/ao_flight.c
+++ b/
src/core/ao_flight.c
@@
-20,6
+20,10
@@
#include <ao_log.h>
#endif
#include <ao_log.h>
#endif
+#if HAS_MPU6000
+#include <ao_quaternion.h>
+#endif
+
#ifndef HAS_ACCEL
#error Please define HAS_ACCEL
#endif
#ifndef HAS_ACCEL
#error Please define HAS_ACCEL
#endif
@@
-117,7
+121,7
@@
ao_flight(void)
{
/* Set pad mode - we can fly! */
ao_flight_state = ao_flight_pad;
{
/* Set pad mode - we can fly! */
ao_flight_state = ao_flight_pad;
-#if HAS_USB &&
HAS_RADIO &&
!HAS_FLIGHT_DEBUG && !HAS_SAMPLE_PROFILE
+#if HAS_USB && !HAS_FLIGHT_DEBUG && !HAS_SAMPLE_PROFILE
/* Disable the USB controller in flight mode
* to save power
*/
/* Disable the USB controller in flight mode
* to save power
*/
@@
-134,8
+138,10
@@
ao_flight(void)
ao_rdf_set(1);
ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_PAD);
#endif
ao_rdf_set(1);
ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_PAD);
#endif
+#if HAS_LED
/* signal successful initialization by turning off the LED */
ao_led_off(AO_LED_RED);
/* signal successful initialization by turning off the LED */
ao_led_off(AO_LED_RED);
+#endif
} else {
/* Set idle mode */
ao_flight_state = ao_flight_idle;
} else {
/* Set idle mode */
ao_flight_state = ao_flight_idle;
@@
-145,8
+151,10
@@
ao_flight(void)
ao_packet_slave_start();
#endif
ao_packet_slave_start();
#endif
+#if HAS_LED
/* signal successful initialization by turning off the LED */
ao_led_off(AO_LED_RED);
/* signal successful initialization by turning off the LED */
ao_led_off(AO_LED_RED);
+#endif
}
/* wakeup threads due to state change */
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
}
/* wakeup threads due to state change */
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
@@
-190,8
+198,8
@@
ao_flight(void)
#if HAS_GPS
/* Record current GPS position by waking up GPS log tasks */
#if HAS_GPS
/* Record current GPS position by waking up GPS log tasks */
- ao_
wakeup(&ao_gps_data)
;
- ao_wakeup(&ao_gps_
tracking_data
);
+ ao_
gps_new = AO_GPS_NEW_DATA | AO_GPS_NEW_TRACKING
;
+ ao_wakeup(&ao_gps_
new
);
#endif
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
#endif
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));