From 2b0a3272fd189a3fc18bff04392af9602aec8b9c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 15 Feb 2018 15:00:41 +1100 Subject: [PATCH] AP_HAL: support LPS25H on MPU AUX --- libraries/AP_HAL/AP_HAL_Boards.h | 1 + libraries/AP_HAL/Device.h | 6 ++++++ libraries/AP_HAL/I2CDevice.h | 6 ------ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libraries/AP_HAL/AP_HAL_Boards.h b/libraries/AP_HAL/AP_HAL_Boards.h index d7111d4aad..015cdf494f 100644 --- a/libraries/AP_HAL/AP_HAL_Boards.h +++ b/libraries/AP_HAL/AP_HAL_Boards.h @@ -112,6 +112,7 @@ #define HAL_BARO_20789_I2C_I2C 14 #define HAL_BARO_20789_I2C_SPI 15 #define HAL_BARO_LPS22H_SPI 16 +#define HAL_BARO_LPS25H_IMU_I2C 17 /* Compass driver types */ #define HAL_COMPASS_NONE 0 diff --git a/libraries/AP_HAL/Device.h b/libraries/AP_HAL/Device.h index 7dffca8e75..7768618050 100644 --- a/libraries/AP_HAL/Device.h +++ b/libraries/AP_HAL/Device.h @@ -78,6 +78,12 @@ public: } } + /* + * Change device address. Note that this is the 7 bit address, it + * does not include the bit for read/write. Only works on I2C + */ + virtual void set_address(uint8_t address) {}; + /* * Set the speed of future transfers. Depending on the bus the speed may * be shared for all devices on the same bus. diff --git a/libraries/AP_HAL/I2CDevice.h b/libraries/AP_HAL/I2CDevice.h index 60aba7afef..5ef5d4a7e6 100644 --- a/libraries/AP_HAL/I2CDevice.h +++ b/libraries/AP_HAL/I2CDevice.h @@ -30,12 +30,6 @@ public: virtual ~I2CDevice() { } - /* - * Change device address. Note that this is the 7 bit address, it - * does not include the bit for read/write. - */ - virtual void set_address(uint8_t address) = 0; - /* Device implementation */ /* See Device::set_speed() */