altos: Add MPU9250 support to self test and data
authorKeith Packard <keithp@keithp.com>
Thu, 12 Oct 2017 07:31:26 +0000 (00:31 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 12 Oct 2017 07:31:26 +0000 (00:31 -0700)
The remaining hooks to make the MPU9250 work in flight.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao.h
src/kernel/ao_data.h

index e56fbb2e4acec01b99a3ce4af8e37147fffc49bf..139050cf78c64136792fbcaf870b170d177f578f 100644 (file)
@@ -78,6 +78,7 @@ typedef AO_PORT_TYPE ao_port_t;
 #define AO_PANIC_SELF_TEST_CC1120      0x40 | 1        /* Self test failure */
 #define AO_PANIC_SELF_TEST_HMC5883     0x40 | 2        /* Self test failure */
 #define AO_PANIC_SELF_TEST_MPU6000     0x40 | 3        /* Self test failure */
+#define AO_PANIC_SELF_TEST_MPU9250     0x40 | 3        /* Self test failure */
 #define AO_PANIC_SELF_TEST_MS5607      0x40 | 4        /* Self test failure */
 
 /* Stop the operating system, beeping and blinking the reason */
index d62852efd69cdc707a7dacf8c49e2f898e18514c..9a3b389c073dd6a291b6776faeb69829533b6ad5 100644 (file)
 #define AO_DATA_MPU6000        0
 #endif
 
+#if HAS_MPU9250
+#include <ao_mpu9250.h>
+#define AO_DATA_MPU9250        (1 << 2)
+#else
+#define AO_DATA_MPU9250        0
+#endif
+
 #if HAS_HMC5883
 #include <ao_hmc5883.h>
 #define AO_DATA_HMC5883        (1 << 3)
@@ -57,7 +64,7 @@
 
 #ifdef AO_DATA_RING
 
-#define AO_DATA_ALL    (AO_DATA_ADC|AO_DATA_MS5607|AO_DATA_MPU6000|AO_DATA_HMC5883|AO_DATA_MMA655X)
+#define AO_DATA_ALL    (AO_DATA_ADC|AO_DATA_MS5607|AO_DATA_MPU6000|AO_DATA_HMC5883|AO_DATA_MMA655X|AO_DATA_MPU9250)
 
 struct ao_data {
        uint16_t                        tick;
@@ -74,6 +81,9 @@ struct ao_data {
        int16_t                         z_accel;
 #endif
 #endif
+#if HAS_MPU9250
+       struct ao_mpu9250_sample        mpu9250;
+#endif
 #if HAS_HMC5883
        struct ao_hmc5883_sample        hmc5883;
 #endif