altos: Use ao_data_accel_invert when changing orientation value
[fw/altos] / src / kernel / ao_data.h
index 3918f4e04e4b9cf6931fcb5aaa85ad50695bc083..abbace8e88981463326d8fbb83593009028ab9d3 100644 (file)
@@ -328,8 +328,6 @@ typedef int16_t     accel_t;
 
 #define HAS_ACCEL      1
 
 
 #define HAS_ACCEL      1
 
-#define AO_ACCEL_INVERT                0
-
 typedef int16_t accel_t;
 
 /* MPU6000 is hooked up so that positive y is positive acceleration */
 typedef int16_t accel_t;
 
 /* MPU6000 is hooked up so that positive y is positive acceleration */
@@ -382,6 +380,7 @@ typedef int16_t angle_t;    /* in degrees */
 /* X axis is aligned in the other board axis (across) */
 /* Z axis is aligned perpendicular to the board (through) */
 
 /* X axis is aligned in the other board axis (across) */
 /* Z axis is aligned perpendicular to the board (through) */
 
+#ifndef ao_data_along
 #define ao_data_along(packet)  ((packet)->mpu9250.accel_y)
 #define ao_data_across(packet) ((packet)->mpu9250.accel_x)
 #define ao_data_through(packet)        ((packet)->mpu9250.accel_z)
 #define ao_data_along(packet)  ((packet)->mpu9250.accel_y)
 #define ao_data_across(packet) ((packet)->mpu9250.accel_x)
 #define ao_data_through(packet)        ((packet)->mpu9250.accel_z)
@@ -389,6 +388,7 @@ typedef int16_t angle_t;    /* in degrees */
 #define ao_data_roll(packet)   ((packet)->mpu9250.gyro_y)
 #define ao_data_pitch(packet)  ((packet)->mpu9250.gyro_x)
 #define ao_data_yaw(packet)    ((packet)->mpu9250.gyro_z)
 #define ao_data_roll(packet)   ((packet)->mpu9250.gyro_y)
 #define ao_data_pitch(packet)  ((packet)->mpu9250.gyro_x)
 #define ao_data_yaw(packet)    ((packet)->mpu9250.gyro_z)
+#endif
 
 static inline float ao_convert_gyro(float sensor)
 {
 
 static inline float ao_convert_gyro(float sensor)
 {
@@ -425,9 +425,11 @@ typedef int16_t ao_mag_t;          /* in raw sample units */
  * sensors. Also, the Z axis is flipped in sign.
  */
 
  * sensors. Also, the Z axis is flipped in sign.
  */
 
+#ifndef ao_data_mag_along
 #define ao_data_mag_along(packet)      ((packet)->mpu9250.mag_x)
 #define ao_data_mag_across(packet)     ((packet)->mpu9250.mag_y)
 #define ao_data_mag_through(packet)    ((packet)->mpu9250.mag_z)
 #define ao_data_mag_along(packet)      ((packet)->mpu9250.mag_x)
 #define ao_data_mag_across(packet)     ((packet)->mpu9250.mag_y)
 #define ao_data_mag_through(packet)    ((packet)->mpu9250.mag_z)
+#endif
 
 #endif
 
 
 #endif