AP_RangeFinder: fix LightwareI2C conversion to I2CDevice

This commit is contained in:
Jonathan Challinger 2016-07-25 12:29:38 -07:00 committed by Lucas De Marchi
parent 5108b4cbb6
commit 4dfb277683
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}