altos: Flip acceleration data consistently for orientation changes
[fw/altos] / src / core / ao_data.h
index e1d8a1392acc537b1925de297caecf0afac93c3c..c4b062fdb1d0f9f4631354ada9b2baa30df9910a 100644 (file)
@@ -273,14 +273,16 @@ typedef int16_t accel_t;
 
 /* MMA655X is hooked up so that positive values represent negative acceleration */
 
+#define AO_ACCEL_INVERT                4095
+
 #define ao_data_accel(packet)                  ((packet)->mma655x)
 #if AO_MMA655X_INVERT
-#define ao_data_accel_cook(packet)             (4095 - (packet)->mma655x)
+#define ao_data_accel_cook(packet)             (AO_ACCEL_INVERT - (packet)->mma655x)
 #else
 #define ao_data_accel_cook(packet)             ((packet)->mma655x)
 #endif
 #define ao_data_set_accel(packet, accel)       ((packet)->mma655x = (accel))
-#define ao_data_accel_invert(accel)            (4095 - (accel))
+#define ao_data_accel_invert(accel)            (AO_ACCEL_INVERT - (accel))
 
 #endif
 
@@ -288,6 +290,8 @@ typedef int16_t accel_t;
 
 #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 */