From 324f3bfa40bf83b47159208563b11e1459ad6bef Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:58:54 +0100 Subject: [PATCH] Experimental bmp390 support. --- src/main/drivers/barometer/barometer_bmp388.c | 5 +++-- src/main/target/common_post.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/drivers/barometer/barometer_bmp388.c b/src/main/drivers/barometer/barometer_bmp388.c index 0abdc6ab7b5..910959faeaf 100644 --- a/src/main/drivers/barometer/barometer_bmp388.c +++ b/src/main/drivers/barometer/barometer_bmp388.c @@ -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) @@ -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; } }; diff --git a/src/main/target/common_post.h b/src/main/target/common_post.h index fddd8b2a906..104898c92f5 100644 --- a/src/main/target/common_post.h +++ b/src/main/target/common_post.h @@ -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