Skip to content
Browse files

MS5611: Fix CONFIG_MS5611_SERIAL definitions.

- Make sure the values are defined as integers.  We were always using
  SPI rather than using I2C when desired.
  • Loading branch information...
1 parent f7233ea commit de8ad1e5092d99b7ac5deeab014e0ebd42290e9f @jamesjb jamesjb committed Jan 8, 2013
Showing with 10 additions and 7 deletions.
  1. +2 −2 ArduCopter/ArduCopter.pde
  2. +1 −1 ArduCopter/config.h
  3. +3 −0 ArduCopter/defines.h
  4. +2 −2 ArduPlane/ArduPlane.pde
  5. +1 −1 ArduPlane/config.h
  6. +1 −1 Tools/VARTest/config.h
View
4 ArduCopter/ArduCopter.pde
@@ -209,9 +209,9 @@ AP_Baro_BMP085 barometer;
#elif CONFIG_BARO == AP_BARO_PX4
AP_Baro_PX4 barometer;
#elif CONFIG_BARO == AP_BARO_MS5611
- #if CONFIG_MS5611_SERIAL == SPI
+ #if CONFIG_MS5611_SERIAL == AP_BARO_MS5611_SPI
AP_Baro_MS5611 barometer(&AP_Baro_MS5611::spi);
- #elif CONFIG_MS5611_SERIAL == I2C
+ #elif CONFIG_MS5611_SERIAL == AP_BARO_MS5611_I2C
AP_Baro_MS5611 barometer(&AP_Baro_MS5611::i2c);
#else
#error Unrecognized CONFIG_MS5611_SERIAL setting.
View
2 ArduCopter/config.h
@@ -63,7 +63,7 @@
# define CONFIG_BARO AP_BARO_BMP085
# else // APM2 Production Hardware (default)
# define CONFIG_BARO AP_BARO_MS5611
- # define CONFIG_MS5611_SERIAL SPI
+ # define CONFIG_MS5611_SERIAL AP_BARO_MS5611_SPI
# endif
#elif CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
# define CONFIG_IMU_TYPE CONFIG_IMU_SITL
View
3 ArduCopter/defines.h
@@ -424,6 +424,9 @@ enum gcs_severity {
#define AP_BARO_MS5611 2
#define AP_BARO_PX4 3
+#define AP_BARO_MS5611_SPI 1
+#define AP_BARO_MS5611_I2C 2
+
// Error message sub systems and error codes
#define ERROR_SUBSYSTEM_MAIN 1
#define ERROR_SUBSYSTEM_RADIO 2
View
4 ArduPlane/ArduPlane.pde
@@ -155,9 +155,9 @@ static AP_Baro_BMP085 barometer;
#elif CONFIG_BARO == AP_BARO_PX4
static AP_Baro_PX4 barometer;
#elif CONFIG_BARO == AP_BARO_MS5611
- #if CONFIG_MS5611_SERIAL == SPI
+ #if CONFIG_MS5611_SERIAL == AP_BARO_MS5611_SPI
static AP_Baro_MS5611 barometer(&AP_Baro_MS5611::spi);
- #elif CONFIG_MS5611_SERIAL == I2C
+ #elif CONFIG_MS5611_SERIAL == AP_BARO_MS5611_I2C
static AP_Baro_MS5611 barometer(&AP_Baro_MS5611::i2c);
#else
#error Unrecognized CONFIG_MS5611_SERIAL setting.
View
2 ArduPlane/config.h
@@ -121,7 +121,7 @@
# define CONFIG_BARO AP_BARO_BMP085
# else // APM2 Production Hardware (default)
# define CONFIG_BARO AP_BARO_MS5611
- # define CONFIG_MS5611_SERIAL SPI
+ # define CONFIG_MS5611_SERIAL AP_BARO_MS5611_SPI
# endif
#elif CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
# define A_LED_PIN 27
View
2 Tools/VARTest/config.h
@@ -54,7 +54,7 @@
# define CONFIG_PITOT_SOURCE PITOT_SOURCE_ANALOG_PIN
# define MAGNETOMETER ENABLED
# define CONFIG_BARO AP_BARO_MS5611
-# define CONFIG_MS5611_SERIAL SPI
+# define CONFIG_MS5611_SERIAL AP_BARO_MS5611_SPI
# define A_LED_PIN 27
# define B_LED_PIN 26

0 comments on commit de8ad1e

Please sign in to comment.
Something went wrong with that request. Please try again.