Merge pull request #9656 from gereic/master
This commit is contained in:
commit
596c21686c
|
@ -42,6 +42,7 @@
|
||||||
|
|
||||||
#define BMP280_I2C_ADDR (0x76)
|
#define BMP280_I2C_ADDR (0x76)
|
||||||
#define BMP280_DEFAULT_CHIP_ID (0x58)
|
#define BMP280_DEFAULT_CHIP_ID (0x58)
|
||||||
|
#define BME280_DEFAULT_CHIP_ID (0x60)
|
||||||
|
|
||||||
#define BMP280_CHIP_ID_REG (0xD0) /* Chip ID Register */
|
#define BMP280_CHIP_ID_REG (0xD0) /* Chip ID Register */
|
||||||
#define BMP280_RST_REG (0xE0) /* Softreset 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 */
|
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);
|
bmp280BusDeinit(busdev);
|
||||||
if (defaultAddressApplied) {
|
if (defaultAddressApplied) {
|
||||||
busdev->busdev_u.i2c.address = 0;
|
busdev->busdev_u.i2c.address = 0;
|
||||||
|
|
Loading…
Reference in New Issue