From 83bbee491c1c6456eee540a14e7ce08ad6f02989 Mon Sep 17 00:00:00 2001 From: Mikhail Avkhimenia Date: Wed, 23 Jul 2014 16:45:58 +0400 Subject: [PATCH] AP_Baro_MS5611: add address switch for Navio board --- libraries/AP_Baro/AP_Baro_MS5611.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Baro/AP_Baro_MS5611.cpp b/libraries/AP_Baro/AP_Baro_MS5611.cpp index a526c0c805..3a6c8541de 100644 --- a/libraries/AP_Baro/AP_Baro_MS5611.cpp +++ b/libraries/AP_Baro/AP_Baro_MS5611.cpp @@ -88,7 +88,7 @@ void AP_Baro_MS5611_SPI::init() hal.scheduler->panic(PSTR("PANIC: AP_Baro_MS5611 did not get " "valid SPI semaphroe!")); return; /* never reached */ - + } // now that we have initialised, we set the SPI bus speed to high @@ -157,8 +157,12 @@ void AP_Baro_MS5611_SPI::sem_give() // I2C Device ////////////////////////////////////////////////////////////////// #if MS5611_WITH_I2C -/** I2C address of the MS5611 on the PX4 board. */ -#define MS5611_ADDR 0x76 + +#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO +#define MS5611_ADDR 0x77 +#else +#define MS5611_ADDR 0x76 /** I2C address of the MS5611 on the PX4 board. */ +#endif void AP_Baro_MS5611_I2C::init() { @@ -488,4 +492,3 @@ float AP_Baro_MS5611::get_temperature() // temperature in degrees C units return Temp; } -