AP_Baro: Add MS5637 over I2C to init()

This commit is contained in:
José Roberto de Souza 2015-09-28 14:32:21 -03:00 committed by Andrew Tridgell
parent 6215a3d224
commit 9a98eb35fc

View File

@ -308,7 +308,14 @@ void AP_Baro::init(void)
drivers[0] = new AP_Baro_MS5607(*this, new AP_SerialBus_I2C(hal.i2c1, HAL_BARO_MS5607_I2C_ADDR), true);
_num_drivers = 1;
}
#endif
#elif HAL_BARO_DEFAULT == HAL_BARO_MS5637_I2C
{
AP_SerialBus *bus = new AP_SerialBus_I2C(HAL_BARO_MS5611_I2C_POINTER,
HAL_BARO_MS5611_I2C_ADDR);
drivers[0] = new AP_Baro_MS5637(*this, bus, true);
_num_drivers = 1;
}
#endif
if (_num_drivers == 0 || _num_sensors == 0 || drivers[0] == NULL) {
hal.scheduler->panic(PSTR("Baro: unable to initialise driver"));
}