AP_Baro_MS5611: add address switch for Navio board

This commit is contained in:
Mikhail Avkhimenia 2014-07-23 16:45:58 +04:00 committed by Andrew Tridgell
parent 784533e9c8
commit 83bbee491c

View File

@ -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;
}