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 Andrew Tridgell
parent 92791821c1
commit 4769055c4a
1 changed files with 1 additions and 0 deletions

View File

@ -80,6 +80,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;
}