AP_BoardConfig: changes in response to review
This commit is contained in:
parent
042623cd0d
commit
40684b95d7
@ -155,14 +155,16 @@ bool AP_BoardConfig::spi_check_register(const char *devname, uint8_t regnum, uin
|
|||||||
|
|
||||||
static bool check_ms5611(const char* devname) {
|
static bool check_ms5611(const char* devname) {
|
||||||
auto dev = hal.spi->get_device(devname);
|
auto dev = hal.spi->get_device(devname);
|
||||||
AP_HAL::Semaphore *dev_sem = dev->get_semaphore();
|
if (!dev) {
|
||||||
if (!dev || !dev_sem) {
|
|
||||||
#if SPI_PROBE_DEBUG
|
#if SPI_PROBE_DEBUG
|
||||||
hal.console->printf("%s: no device\n", devname);
|
hal.console->printf("%s: no device\n", devname);
|
||||||
#endif
|
#endif
|
||||||
return false;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user