From e575bc264e86e70e687317a134dacdbf1a3e4fc4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Jan 2015 22:27:45 +1100 Subject: [PATCH] Rover: updates for new AP_Baro API --- APMrover2/APMrover2.pde | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/APMrover2/APMrover2.pde b/APMrover2/APMrover2.pde index d95ab7b72b..d428941142 100644 --- a/APMrover2/APMrover2.pde +++ b/APMrover2/APMrover2.pde @@ -201,21 +201,7 @@ static AP_GPS gps; // flight modes convenience array static AP_Int8 *modes = &g.mode1; -#if CONFIG_BARO == HAL_BARO_BMP085 -static AP_Baro_BMP085 barometer; -#elif CONFIG_BARO == HAL_BARO_PX4 -static AP_Baro_PX4 barometer; -#elif CONFIG_BARO == HAL_BARO_VRBRAIN -static AP_Baro_VRBRAIN barometer; -#elif CONFIG_BARO == HAL_BARO_HIL -static AP_Baro_HIL barometer; -#elif CONFIG_BARO == HAL_BARO_MS5611 -static AP_Baro_MS5611 barometer(&AP_Baro_MS5611::i2c); -#elif CONFIG_BARO == HAL_BARO_MS5611_SPI -static AP_Baro_MS5611 barometer(&AP_Baro_MS5611::spi); -#else - #error Unrecognized CONFIG_BARO setting -#endif +static AP_Baro barometer; #if CONFIG_COMPASS == HAL_COMPASS_PX4 static AP_Compass_PX4 compass; @@ -639,7 +625,7 @@ static void mount_update(void) static void update_alt() { - barometer.read(); + barometer.update(); if (should_log(MASK_LOG_IMU)) { Log_Write_Baro(); }