AP_Baro: use HAL_SEMAPHORE_BLOCK_FOREVER

This commit is contained in:
Peter Barker 2018-01-02 11:22:40 +11:00 committed by Andrew Tridgell
parent ea83a487d4
commit 05fb28c7f9

View File

@ -128,7 +128,7 @@ bool AP_Baro_ICM20789::init()
debug("Looking for 20789 baro\n");
#ifdef HAL_INS_MPU60x0_NAME
if (!dev->get_semaphore()->take(0)) {
if (!dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) {
AP_HAL::panic("PANIC: AP_Baro_ICM20789: failed to take serial semaphore for init");
}
@ -141,7 +141,7 @@ bool AP_Baro_ICM20789::init()
debug("Setting up IMU\n");
dev_icm = hal.spi->get_device(HAL_INS_MPU60x0_NAME);
if (!dev_icm->get_semaphore()->take(0)) {
if (!dev_icm->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) {
AP_HAL::panic("PANIC: AP_Baro_ICM20789: failed to take serial semaphore ICM");
}
@ -273,7 +273,7 @@ void AP_Baro_ICM20789::convert_data(uint32_t Praw, uint32_t Traw)
return;
}
if (_sem->take(0)) {
if (_sem->take(HAL_SEMAPHORE_BLOCK_FOREVER)) {
#if BARO_ICM20789_DEBUG
dd.Praw = Praw;
dd.Traw = Traw;