Treat BME280 as BMP280

This commit is contained in:
Bruce Luckcuck 2020-03-26 19:45:07 -04:00 committed by mikeller
parent c1dc66b452
commit 09902daaf6
1 changed files with 2 additions and 1 deletions

View File

@ -42,6 +42,7 @@
#define BMP280_I2C_ADDR (0x76)
#define BMP280_DEFAULT_CHIP_ID (0x58)
#define BME280_DEFAULT_CHIP_ID (0x60)
#define BMP280_CHIP_ID_REG (0xD0) /* Chip ID Register */
#define BMP280_RST_REG (0xE0) /* Softreset Register */
@ -162,7 +163,7 @@ bool bmp280Detect(baroDev_t *baro)
busReadRegisterBuffer(busdev, BMP280_CHIP_ID_REG, &bmp280_chip_id, 1); /* read Chip Id */
if (bmp280_chip_id != BMP280_DEFAULT_CHIP_ID) {
if ((bmp280_chip_id != BMP280_DEFAULT_CHIP_ID) || (bmp280_chip_id != BME280_DEFAULT_CHIP_ID)) {
bmp280BusDeinit(busdev);
if (defaultAddressApplied) {
busdev->busdev_u.i2c.address = 0;