Browse Source

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
master
Andrew Tridgell 6 years ago
parent
commit
0f6b8375bb
  1. 4
      libraries/AP_RangeFinder/RangeFinder.cpp

4
libraries/AP_RangeFinder/RangeFinder.cpp

@ -380,6 +380,10 @@ void RangeFinder::detect_instance(uint8_t instance, uint8_t& serial_instance) @@ -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)));

Loading…
Cancel
Save