From 0c8adf25c2c0c35945f3889aa16310138ed2d96e Mon Sep 17 00:00:00 2001 From: Nicholas Sherlock Date: Sat, 7 Mar 2015 01:57:45 +1300 Subject: [PATCH] Use defines for MAG_MAX and ACC_MAX --- src/main/sensors/acceleration.h | 4 ++-- src/main/sensors/compass.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/sensors/acceleration.h b/src/main/sensors/acceleration.h index d1403c71c..cd13a01a4 100644 --- a/src/main/sensors/acceleration.h +++ b/src/main/sensors/acceleration.h @@ -29,10 +29,10 @@ typedef enum { ACC_SPI_MPU6000 = 7, ACC_SPI_MPU6500 = 8, ACC_FAKE = 9, - - ACC_MAX = ACC_FAKE } accelerationSensor_e; +#define ACC_MAX ACC_FAKE + extern sensor_align_e accAlign; extern acc_t acc; extern uint16_t acc_1G; diff --git a/src/main/sensors/compass.h b/src/main/sensors/compass.h index 00cba565c..8c1eb7199 100644 --- a/src/main/sensors/compass.h +++ b/src/main/sensors/compass.h @@ -17,16 +17,16 @@ #pragma once -// Type of accelerometer used/detected +// Type of magnetometer used/detected typedef enum { MAG_DEFAULT = 0, MAG_NONE = 1, MAG_HMC5883 = 2, - MAG_AK8975 = 3, - - MAG_MAX = MAG_AK8975 + MAG_AK8975 = 3 } magSensor_e; +#define MAG_MAX MAG_AK8975 + #ifdef MAG void compassInit(void); void updateCompass(flightDynamicsTrims_t *magZero);