mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Baro: use HAL_SEMAPHORE_BLOCK_FOREVER
This commit is contained in:
parent
ea83a487d4
commit
05fb28c7f9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user