AP_TemperatureSensor: use take_blocking instead of HAL_SEMAPHORE_BLOCK_FOREVER

this makes for cleaner and smaller code as the failure case is not
needed
This commit is contained in:
Andrew Tridgell 2020-01-19 08:42:34 +11:00
parent 7dcb5c60b0
commit 7bc364a338
1 changed files with 1 additions and 3 deletions

View File

@ -21,9 +21,7 @@ bool TSYS01::init(uint8_t bus)
return false;
}
if (!_dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) {
AP_HAL::panic("PANIC: TSYS01: failed to take serial semaphore for init");
}
_dev->get_semaphore()->take_blocking();
_dev->set_retries(10);