Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions libraries/AP_Baro/AP_Baro_BMP581.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,20 @@ bool AP_Baro_BMP581::init()
void AP_Baro_BMP581::timer(void)
{
uint8_t buf[6];
uint8_t buf2[6];

// read twice, make sure results are consistent; corruption has
// been seen from data on this sensor
if (!_dev->read_registers(BMP581_REG_TEMP_DATA_XLSB, buf, sizeof(buf))) {
return;
}
if (!_dev->read_registers(BMP581_REG_TEMP_DATA_XLSB, buf2, sizeof(buf2))) {
return;
}
if (memcmp(buf, buf2, ARRAY_SIZE(buf)) != 0) {
// we didn't get the same data twice. Reject.
return;
}

WITH_SEMAPHORE(_sem);

Expand Down
4 changes: 4 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6X/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ PI5 TIM8_CH1 TIM8 RCININT PULLDOWN LOW
BARO BMP388 I2C:2:0x76
BARO BMP388 I2C:0:0x77

# barometers (Holybro 6X more recent versions)
BARO BMP581 I2C:2:0x46
BARO BMP581 I2C:0:0x46

# barometers (CUAV 6X)
BARO ICP201XX I2C:0:0x64
BARO ICP201XX I2C:2:0x63
Expand Down
Loading