AP_BoardConfig: changes in response to review

This commit is contained in:
Jonathan Challinger 2019-04-23 15:39:47 -07:00 committed by Andrew Tridgell
parent 042623cd0d
commit 40684b95d7

View File

@ -155,14 +155,16 @@ bool AP_BoardConfig::spi_check_register(const char *devname, uint8_t regnum, uin
static bool check_ms5611(const char* devname) {
auto dev = hal.spi->get_device(devname);
AP_HAL::Semaphore *dev_sem = dev->get_semaphore();
if (!dev || !dev_sem) {
if (!dev) {
#if SPI_PROBE_DEBUG
hal.console->printf("%s: no device\n", devname);
#endif
return false;
}
if (!dev_sem->take(HAL_SEMAPHORE_BLOCK_FOREVER)) {
AP_HAL::Semaphore *dev_sem = dev->get_semaphore();
if (!dev_sem || !dev_sem->take(HAL_SEMAPHORE_BLOCK_FOREVER)) {
return false;
}