diff options
author | Keith Packard <keithp@keithp.com> | 2012-06-01 23:07:38 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-06-01 23:07:38 -0700 |
commit | c04af7533bd3fd3f3260338c0753fde966131720 (patch) | |
tree | a965c742dcfc4dc1dd76e44aee0ddfd3fbf8b076 /src/core/ao_data.h | |
parent | 1824761f5b98e92485e2dd347b1c4d043ec207e2 (diff) |
altos: Add support for MegaAccel daughter card.
Switches all acceleration computation to using the MegaAccel
accelerometer to ensure support for high-g flights.
MPU6000 values continue to be logged as normal
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/core/ao_data.h')
-rw-r--r-- | src/core/ao_data.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core/ao_data.h b/src/core/ao_data.h index bb26c4c0..83f8df59 100644 --- a/src/core/ao_data.h +++ b/src/core/ao_data.h @@ -31,9 +31,6 @@ struct ao_data { #if HAS_ADC struct ao_adc adc; #endif -#if HAS_ACCEL_REF - uint16_t accel_ref; -#endif #if HAS_MS5607 struct ao_ms5607_sample ms5607; #endif @@ -82,7 +79,7 @@ typedef int16_t alt_t; * ao_data_accel_invert - flip rocket ends for positive acceleration */ -#if HAS_MPU6000 +#if HAS_MPU6000 && !HAS_HIGHG_ACCEL typedef int16_t accel_t; @@ -181,7 +178,7 @@ typedef int16_t accel_t; */ #if HAS_ACCEL_REF #define ao_data_accel_sample(packet) \ - ((uint16_t) ((((uint32_t) (packet)->adc.accel << 16) / ((packet)->accel_ref << 1))) >> 1) + ((uint16_t) ((((uint32_t) (packet)->adc.accel << 16) / ((packet)->adc.accel_ref << 1))) >> 1) #else #define ao_data_accel_sample(packet) ((packet)->adc.accel) #endif /* HAS_ACCEL_REF */ |