#include <ao_mpu6000.h>
#endif
+#if HAS_HMC5883
+#include <ao_hmc5883.h>
+#endif
+
struct ao_data {
uint16_t tick;
#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
#if HAS_MPU6000
struct ao_mpu6000_sample mpu6000;
#endif
+#if HAS_HMC5883
+ struct ao_hmc5883_sample hmc5883;
+#endif
};
#define ao_data_ring_next(n) (((n) + 1) & (AO_DATA_RING - 1))
* ao_data_accel_invert - flip rocket ends for positive acceleration
*/
-#if HAS_MPU6000
+#if HAS_MPU6000 && !HAS_HIGHG_ACCEL
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(packet) ((packet)->adc.accel)
+#define ao_data_accel_sample(packet) ((packet)->adc.accel)
#endif /* HAS_ACCEL_REF */
#endif /* else some other pressure sensor */