mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
AP_Baro: Add BME280 ID in BMP280
BME280 has the same memory layout than BMP280, but with more features. Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
parent
6230524636
commit
d36157f314
@ -34,6 +34,7 @@ extern const AP_HAL::HAL &hal;
|
|||||||
#define BMP280_FILTER_COEFFICIENT 2
|
#define BMP280_FILTER_COEFFICIENT 2
|
||||||
|
|
||||||
#define BMP280_ID 0x58
|
#define BMP280_ID 0x58
|
||||||
|
#define BME280_ID 0x60
|
||||||
|
|
||||||
#define BMP280_REG_CALIB 0x88
|
#define BMP280_REG_CALIB 0x88
|
||||||
#define BMP280_REG_ID 0xD0
|
#define BMP280_REG_ID 0xD0
|
||||||
@ -77,8 +78,8 @@ bool AP_Baro_BMP280::_init()
|
|||||||
|
|
||||||
uint8_t whoami;
|
uint8_t whoami;
|
||||||
if (!_dev->read_registers(BMP280_REG_ID, &whoami, 1) ||
|
if (!_dev->read_registers(BMP280_REG_ID, &whoami, 1) ||
|
||||||
whoami != BMP280_ID) {
|
(whoami != BME280_ID && whoami != BMP280_ID)) {
|
||||||
// not a BMP280
|
// not a BMP280 or BME280
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user