Skip to content

Commit

Permalink
Include bmp ID in initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaBologna committed Nov 17, 2020
1 parent e6dd821 commit 5ed6f24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bme280.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ int8_t bme280_init(struct bme280_dev *dev) {
rslt = bme280_get_regs(BME280_CHIP_ID_ADDR, &chip_id, 1, dev);

/* Check for chip id validity */
if ((rslt == BME280_OK) && (chip_id == BME280_CHIP_ID))
if ((rslt == BME280_OK) && ((chip_id == BME280_CHIP_ID) || (chip_id == BMP280_CHIP_ID1 || chip_id == BMP280_CHIP_ID2 || chip_id == BMP280_CHIP_ID3)) )
{
dev->chip_id = chip_id;

Expand Down
5 changes: 5 additions & 0 deletions bme280_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@
/**\name BME280 chip identifier */
#define BME280_CHIP_ID UINT8_C(0x60)


#define BMP280_CHIP_ID1 UINT8_C(0x56)
#define BMP280_CHIP_ID2 UINT8_C(0x57)
#define BMP280_CHIP_ID3 UINT8_C(0x58)

/**\name Register Address */
#define BME280_CHIP_ID_ADDR UINT8_C(0xD0)
#define BME280_RESET_ADDR UINT8_C(0xE0)
Expand Down

0 comments on commit 5ed6f24

Please sign in to comment.