AP_RangeFinder: added a 1.5 delay to probe of LW20 I2C

the LW20 takes a long time to boot and be ready to probe
This commit is contained in:
Andrew Tridgell 2019-07-19 16:56:40 +10:00
parent bcfdc91900
commit 0f6b8375bb

View File

@ -380,6 +380,10 @@ void RangeFinder::detect_instance(uint8_t instance, uint8_t& serial_instance)
break;
case RangeFinder_TYPE_LWI2C:
if (params[instance].address) {
// the LW20 needs a long time to boot up, so we delay 1.5s here
if (!hal.util->was_watchdog_armed()) {
hal.scheduler->delay(1500);
}
#ifdef HAL_RANGEFINDER_LIGHTWARE_I2C_BUS
_add_backend(AP_RangeFinder_LightWareI2C::detect(state[instance], params[instance],
hal.i2c_mgr->get_device(HAL_RANGEFINDER_LIGHTWARE_I2C_BUS, params[instance].address)));