mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 00:04:02 -04:00
AP_Rangefinder: look in buses 0/1 when Lightware I2C bus isn't defined
This commit is contained in:
parent
7e5f98b535
commit
bb46eaedaa
@ -618,8 +618,16 @@ void RangeFinder::detect_instance(uint8_t instance)
|
|||||||
break;
|
break;
|
||||||
case RangeFinder_TYPE_LWI2C:
|
case RangeFinder_TYPE_LWI2C:
|
||||||
if (state[instance].address) {
|
if (state[instance].address) {
|
||||||
|
#ifdef HAL_RANGEFINDER_LIGHTWARE_I2C_BUS
|
||||||
_add_backend(AP_RangeFinder_LightWareI2C::detect(state[instance],
|
_add_backend(AP_RangeFinder_LightWareI2C::detect(state[instance],
|
||||||
hal.i2c_mgr->get_device(HAL_RANGEFINDER_LIGHTWARE_I2C_BUS, state[instance].address)));
|
hal.i2c_mgr->get_device(HAL_RANGEFINDER_LIGHTWARE_I2C_BUS, state[instance].address)));
|
||||||
|
#else
|
||||||
|
if (!_add_backend(AP_RangeFinder_LightWareI2C::detect(state[instance],
|
||||||
|
hal.i2c_mgr->get_device(1, state[instance].address)))) {
|
||||||
|
_add_backend(AP_RangeFinder_LightWareI2C::detect(state[instance],
|
||||||
|
hal.i2c_mgr->get_device(0, state[instance].address)));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RangeFinder_TYPE_TRI2C:
|
case RangeFinder_TYPE_TRI2C:
|
||||||
|
Loading…
Reference in New Issue
Block a user