mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Baro: fix LPS22H on I2C
This commit is contained in:
parent
2348fa4201
commit
3fa419e132
@ -159,8 +159,13 @@ bool AP_Baro_LPS2XH::_init()
|
|||||||
CallTime = 40 * AP_USEC_PER_MSEC;
|
CallTime = 40 * AP_USEC_PER_MSEC;
|
||||||
}
|
}
|
||||||
if(_lps2xh_type == BARO_LPS22H){
|
if(_lps2xh_type == BARO_LPS22H){
|
||||||
_dev->write_register(LPS22H_CTRL_REG1,LPS22H_CTRL_REG1_ODR_75HZ|LPS22H_CTRL_REG1_BDU|LPS22H_CTRL_REG1_EN_LPFP|LPS22H_CTRL_REG1_LPFP_CFG);
|
_dev->write_register(LPS22H_CTRL_REG1, 0x00); // turn off for config
|
||||||
_dev->write_register(LPS22H_CTRL_REG2,0x18);
|
_dev->write_register(LPS22H_CTRL_REG1, LPS22H_CTRL_REG1_ODR_75HZ|LPS22H_CTRL_REG1_BDU|LPS22H_CTRL_REG1_EN_LPFP|LPS22H_CTRL_REG1_LPFP_CFG);
|
||||||
|
if (_dev->bus_type() == AP_HAL::Device::BUS_TYPE_SPI) {
|
||||||
|
_dev->write_register(LPS22H_CTRL_REG2, 0x18); // disable i2c
|
||||||
|
} else {
|
||||||
|
_dev->write_register(LPS22H_CTRL_REG2, 0x10);
|
||||||
|
}
|
||||||
|
|
||||||
// request 75Hz update
|
// request 75Hz update
|
||||||
CallTime = 1000000/75;
|
CallTime = 1000000/75;
|
||||||
|
Loading…
Reference in New Issue
Block a user