Browse Source

AP_RangeFinder: fix LightwareI2C conversion to I2CDevice

mission-4.1.18
Jonathan Challinger 9 years ago committed by Lucas De Marchi
parent
commit
4dfb277683
  1. 3
      libraries/AP_RangeFinder/AP_RangeFinder_LightWareI2C.cpp

3
libraries/AP_RangeFinder/AP_RangeFinder_LightWareI2C.cpp

@ -62,8 +62,9 @@ bool AP_RangeFinder_LightWareI2C::get_reading(uint16_t &reading_cm) @@ -62,8 +62,9 @@ bool AP_RangeFinder_LightWareI2C::get_reading(uint16_t &reading_cm)
return false;
}
// exit immediately if we can't take the semaphore
if (!_dev || _dev->get_semaphore()->take(1)) {
if (!_dev || !_dev->get_semaphore()->take(1)) {
return false;
}

Loading…
Cancel
Save