Browse Source

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
c415-sdk
Andrew Tridgell 5 years ago
parent
commit
7bc364a338
  1. 4
      libraries/AP_TemperatureSensor/TSYS01.cpp

4
libraries/AP_TemperatureSensor/TSYS01.cpp

@ -21,9 +21,7 @@ bool TSYS01::init(uint8_t bus) @@ -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);

Loading…
Cancel
Save