altos: Add MMC5983 driver
[fw/altos] / src / kernel / ao_log_mega.c
index 0ae4e53616c9f57a16478cc161a8cdee7c56ce48..85d2aa5c0ec80e2453d6b391f72f37527b21039e 100644 (file)
@@ -22,7 +22,7 @@
 #include <ao_flight.h>
 
 #if HAS_FLIGHT
-static __data uint8_t  ao_log_data_pos;
+static uint8_t ao_log_data_pos;
 
 /* a hack to make sure that ao_log_megas fill the eeprom block in even units */
 typedef uint8_t check_log_size[1-(256 % sizeof(struct ao_log_mega))] ;
@@ -36,7 +36,7 @@ typedef uint8_t check_log_size[1-(256 % sizeof(struct ao_log_mega))] ;
 void
 ao_log(void)
 {
-       __pdata uint16_t        next_sensor, next_other;
+       uint16_t        next_sensor, next_other;
        uint8_t                 i;
 
        ao_storage_setup();
@@ -104,6 +104,17 @@ ao_log(void)
                                ao_log_data.u.sensor.mag_x = ao_data_ring[ao_log_data_pos].mpu9250.mag_x;
                                ao_log_data.u.sensor.mag_z = ao_data_ring[ao_log_data_pos].mpu9250.mag_z;
                                ao_log_data.u.sensor.mag_y = ao_data_ring[ao_log_data_pos].mpu9250.mag_y;
+#endif
+#if HAS_BMX160
+                               ao_log_data.u.sensor.accel_x = ao_data_ring[ao_log_data_pos].bmx160.acc_x;
+                               ao_log_data.u.sensor.accel_y = ao_data_ring[ao_log_data_pos].bmx160.acc_y;
+                               ao_log_data.u.sensor.accel_z = ao_data_ring[ao_log_data_pos].bmx160.acc_z;
+                               ao_log_data.u.sensor.gyro_x = ao_data_ring[ao_log_data_pos].bmx160.gyr_x;
+                               ao_log_data.u.sensor.gyro_y = ao_data_ring[ao_log_data_pos].bmx160.gyr_y;
+                               ao_log_data.u.sensor.gyro_z = ao_data_ring[ao_log_data_pos].bmx160.gyr_z;
+                               ao_log_data.u.sensor.mag_x = ao_data_ring[ao_log_data_pos].bmx160.mag_x;
+                               ao_log_data.u.sensor.mag_z = ao_data_ring[ao_log_data_pos].bmx160.mag_z;
+                               ao_log_data.u.sensor.mag_y = ao_data_ring[ao_log_data_pos].bmx160.mag_y;
 #endif
                                ao_log_data.u.sensor.accel = ao_data_accel(&ao_data_ring[ao_log_data_pos]);
                                ao_log_write(&ao_log_data);