diff options
author | Keith Packard <keithp@keithp.com> | 2012-07-19 13:41:03 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-07-19 13:41:03 -0700 |
commit | a4678d7552c6981a20608394021f4f8d09dac619 (patch) | |
tree | 34ad0c23463038b16856486ba3a7614a4281a571 | |
parent | e177cfb477f7ce8dc18fa8dcb3208867c0bee336 (diff) |
altos: Allow 'Z' MPU6000 axis to be changed at compile time
This axis selects which axis to use for computing flight acceleration
when no high-g accelerometer is present.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | src/core/ao_data.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/ao_data.h b/src/core/ao_data.h index fdc49ca2..3944edac 100644 --- a/src/core/ao_data.h +++ b/src/core/ao_data.h @@ -91,9 +91,13 @@ typedef int16_t alt_t; typedef int16_t accel_t; /* MPU6000 is hooked up so that positive y is positive acceleration */ -#define ao_data_accel(packet) ((packet)->mpu6000.accel_y) -#define ao_data_accel_cook(packet) (-(packet)->mpu6000.accel_y) -#define ao_data_set_accel(packet, accel) ((packet)->mpu6000.accel_y = (accel)) +#ifndef ao_accel_axis +#define ao_accel_axis accel_y +#endif + +#define ao_data_accel(packet) ((packet)->mpu6000.ao_accel_axis) +#define ao_data_accel_cook(packet) (-(packet)->mpu6000.ao_accel_axis) +#define ao_data_set_accel(packet, accel) ((packet)->mpu6000.ao_accel_axis = (accel)) #define ao_data_accel_invert(a) (-(a)) #else /* HAS_MPU6000 && !HAS_HIGHG_ACCEL */ |