From 352347ba49c9c8eaee16f743a04ec90fbdc9c180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 10 Jan 2020 16:11:36 -0300 Subject: [PATCH] AP_Baro: Add BME280 ID in BMP280 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BME280 has the same memory layout than BMP280, but with more features. Signed-off-by: Patrick José Pereira --- libraries/AP_Baro/AP_Baro_BMP280.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Baro/AP_Baro_BMP280.cpp b/libraries/AP_Baro/AP_Baro_BMP280.cpp index f2831bdbb8..f668e12e41 100644 --- a/libraries/AP_Baro/AP_Baro_BMP280.cpp +++ b/libraries/AP_Baro/AP_Baro_BMP280.cpp @@ -34,6 +34,7 @@ extern const AP_HAL::HAL &hal; #define BMP280_FILTER_COEFFICIENT 2 #define BMP280_ID 0x58 +#define BME280_ID 0x60 #define BMP280_REG_CALIB 0x88 #define BMP280_REG_ID 0xD0 @@ -77,8 +78,8 @@ bool AP_Baro_BMP280::_init() uint8_t whoami; if (!_dev->read_registers(BMP280_REG_ID, &whoami, 1) || - whoami != BMP280_ID) { - // not a BMP280 + (whoami != BME280_ID && whoami != BMP280_ID)) { + // not a BMP280 or BME280 return false; }