From f9375898105f04391fd325e6a87fdfbcd2e92d1a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 23 Aug 2018 08:23:50 +1000 Subject: [PATCH] AP_Baro: fixed BMP085 probe --- libraries/AP_Baro/AP_Baro.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/AP_Baro/AP_Baro.cpp b/libraries/AP_Baro/AP_Baro.cpp index a7b8dfec38..7cd348896e 100644 --- a/libraries/AP_Baro/AP_Baro.cpp +++ b/libraries/AP_Baro/AP_Baro.cpp @@ -507,9 +507,8 @@ void AP_Baro::init(void) drivers[0] = new AP_Baro_HIL(*this); _num_drivers = 1; #elif HAL_BARO_DEFAULT == HAL_BARO_BMP085 - drivers[0] = new AP_Baro_BMP085(*this, - std::move(hal.i2c_mgr->get_device(HAL_BARO_BMP085_BUS, HAL_BARO_BMP085_I2C_ADDR))); - _num_drivers = 1; + ADD_BACKEND(AP_Baro_BMP085::probe(*this, + std::move(hal.i2c_mgr->get_device(HAL_BARO_BMP085_BUS, HAL_BARO_BMP085_I2C_ADDR)))); #elif HAL_BARO_DEFAULT == HAL_BARO_BMP280_I2C ADD_BACKEND(AP_Baro_BMP280::probe(*this, std::move(hal.i2c_mgr->get_device(HAL_BARO_BMP280_BUS, HAL_BARO_BMP280_I2C_ADDR))));