diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_BMI160.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_BMI160.cpp index 94ee571b11..9b0c405fe0 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_BMI160.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_BMI160.cpp @@ -152,7 +152,7 @@ void AP_InertialSensor_BMI160::start() { bool r; - if (!_dev->get_semaphore()->take(0)) { + if (!_dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { return; } @@ -428,7 +428,7 @@ bool AP_InertialSensor_BMI160::_hardware_init() hal.scheduler->delay(BMI160_POWERUP_DELAY_MSEC); - if (!_dev->get_semaphore()->take(0)) { + if (!_dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { return false; } diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp index 9d29e65048..967486b985 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp @@ -97,7 +97,7 @@ void AP_InertialSensor_Backend::_notify_new_gyro_raw_sample(uint8_t instance, delta_coning = delta_coning % delta_angle; delta_coning *= 0.5f; - if (_sem->take(0)) { + if (_sem->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { // integrate delta angle accumulator // the angles and coning corrections are accumulated separately in the // referenced paper, but in simulation little difference was found between @@ -187,7 +187,7 @@ void AP_InertialSensor_Backend::_notify_new_accel_raw_sample(uint8_t instance, _imu.calc_vibration_and_clipping(instance, accel, dt); - if (_sem->take(0)) { + if (_sem->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { // delta velocity _imu._delta_velocity_acc[instance] += accel * dt; _imu._delta_velocity_acc_dt[instance] += dt; @@ -273,7 +273,7 @@ void AP_InertialSensor_Backend::_publish_temperature(uint8_t instance, float tem */ void AP_InertialSensor_Backend::update_gyro(uint8_t instance) { - if (!_sem->take(0)) { + if (!_sem->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { return; } @@ -296,7 +296,7 @@ void AP_InertialSensor_Backend::update_gyro(uint8_t instance) */ void AP_InertialSensor_Backend::update_accel(uint8_t instance) { - if (!_sem->take(0)) { + if (!_sem->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { return; } diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_Invensense.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_Invensense.cpp index 51775cfa20..e011128dee 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_Invensense.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_Invensense.cpp @@ -372,7 +372,7 @@ bool AP_InertialSensor_Invensense::_has_auxiliary_bus() void AP_InertialSensor_Invensense::start() { - if (!_dev->get_semaphore()->take(0)) { + if (!_dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { return; } @@ -825,7 +825,7 @@ bool AP_InertialSensor_Invensense::_check_whoami(void) bool AP_InertialSensor_Invensense::_hardware_init(void) { - if (!_dev->get_semaphore()->take(0)) { + if (!_dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { return false; }