AP_Baro_LPS2XH SPI/IC bug for top bit

This commit is contained in:
EShamaev 2023-03-22 10:50:50 +02:00 committed by Peter Barker
parent 0fdb1eb8a7
commit 4ec74b1373
1 changed files with 3 additions and 1 deletions

View File

@ -146,7 +146,9 @@ bool AP_Baro_LPS2XH::_init()
_dev->set_speed(AP_HAL::Device::SPEED_HIGH);
// top bit is for read on SPI
_dev->set_read_flag(0x80);
if (_dev->bus_type() == AP_HAL::Device::BUS_TYPE_SPI) {
_dev->set_read_flag(0x80);
}
if (!_check_whoami()) {
_dev->get_semaphore()->give();