Skip to content

Commit

Permalink
Merge pull request #10542 from iNavFlight/mmosca-bmp390
Browse files Browse the repository at this point in the history
Experimental bmp390 support.
  • Loading branch information
mmosca authored Dec 17, 2024
2 parents 0ae30d3 + 324f3bf commit 4389286
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/drivers/barometer/barometer_bmp388.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
#include "drivers/barometer/barometer.h"
#include "drivers/barometer/barometer_bmp388.h"

#if defined(USE_BARO) && (defined(USE_BARO_BMP388) || defined(USE_BARO_SPI_BMP388))
#if defined(USE_BARO) && (defined(USE_BARO_BMP388) || defined(USE_BARO_SPI_BMP388) || defined(USE_BARO_BMP390) || defined(USE_BARO_SPI_BMP390))

#define BMP388_I2C_ADDR (0x76) // same as BMP280/BMP180
#define BMP388_DEFAULT_CHIP_ID (0x50) // from https://github.com/BoschSensortec/BMP3-Sensor-API/blob/master/bmp3_defs.h#L130
#define BMP390_DEFAULT_CHIP_ID (0x60) // from https://github.com/BoschSensortec/BMP3-Sensor-API/blob/master/bmp3_defs.h#L133

#define BMP388_CMD_REG (0x7E)
#define BMP388_RESERVED_UPPER_REG (0x7D)
Expand Down Expand Up @@ -314,7 +315,7 @@ static bool deviceDetect(busDevice_t * busDev)

bool ack = busReadBuf(busDev, BMP388_CHIP_ID_REG, chipId, nRead);

if (ack && *pId == BMP388_DEFAULT_CHIP_ID) {
if (ack && (*pId == BMP388_DEFAULT_CHIP_ID || *pId == BMP390_DEFAULT_CHIP_ID)) {
return true;
}
};
Expand Down
1 change: 1 addition & 0 deletions src/main/target/common_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ extern uint8_t __config_end;
#define USE_BARO_BMP085
#define USE_BARO_BMP280
#define USE_BARO_BMP388
#define USE_BARO_BMP390
#define USE_BARO_DPS310
#define USE_BARO_LPS25H
#define USE_BARO_MS5607
Expand Down

0 comments on commit 4389286

Please sign in to comment.