AP_RangeFinder: Give back semaphore on whoami error

This commit is contained in:
pierre-louis.k 2018-08-03 16:42:02 +02:00 committed by Randy Mackay
parent 4d45b68fa3
commit 1b990c116d
1 changed files with 1 additions and 0 deletions

View File

@ -76,6 +76,7 @@ bool AP_RangeFinder_TeraRangerI2C::init(void)
uint8_t whoami;
if (!dev->read_registers(TR_WHOAMI, &whoami, 1) ||
whoami != TR_WHOAMI_VALUE) {
dev->get_semaphore()->give();
return false;
}