mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
AP_RangeFinder: try bus 0 and 1 for PulsedLightI2C rangefinder
This commit is contained in:
parent
516141edf3
commit
a69ff34c80
@ -29,8 +29,13 @@ extern const AP_HAL::HAL& hal;
|
||||
AP_RangeFinder_PulsedLightLRF::AP_RangeFinder_PulsedLightLRF(RangeFinder &_ranger, uint8_t instance,
|
||||
RangeFinder::RangeFinder_State &_state)
|
||||
: AP_RangeFinder_Backend(_ranger, instance, _state)
|
||||
, _dev(hal.i2c_mgr->get_device(1, AP_RANGEFINDER_PULSEDLIGHTLRF_ADDR))
|
||||
{
|
||||
// try external bus first
|
||||
_dev = hal.i2c_mgr->get_device(1, AP_RANGEFINDER_PULSEDLIGHTLRF_ADDR);
|
||||
if (!_dev) {
|
||||
// then internal
|
||||
_dev = hal.i2c_mgr->get_device(0, AP_RANGEFINDER_PULSEDLIGHTLRF_ADDR);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user