Browse Source

AP_InertialSensor: wait forever for semaphore on startup

some boards take a silly amount of time to get semaphore on startup
master
Andrew Tridgell 8 years ago committed by Lucas De Marchi
parent
commit
6129b1abb6
  1. 4
      libraries/AP_InertialSensor/AP_InertialSensor_BMI160.cpp
  2. 6
      libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp
  3. 4
      libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp

4
libraries/AP_InertialSensor/AP_InertialSensor_BMI160.cpp

@ -152,7 +152,7 @@ void AP_InertialSensor_BMI160::start() @@ -152,7 +152,7 @@ void AP_InertialSensor_BMI160::start()
{
bool r;
if (!_dev->get_semaphore()->take(100)) {
if (!_dev->get_semaphore()->take(0)) {
AP_HAL::panic("BMI160: Unable to get semaphore");
}
@ -429,7 +429,7 @@ bool AP_InertialSensor_BMI160::_hardware_init() @@ -429,7 +429,7 @@ bool AP_InertialSensor_BMI160::_hardware_init()
hal.scheduler->delay(BMI160_POWERUP_DELAY_MSEC);
if (!_dev->get_semaphore()->take(100)) {
if (!_dev->get_semaphore()->take(0)) {
AP_HAL::panic("BMI160: Unable to get semaphore");
}

6
libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp

@ -344,7 +344,7 @@ bool AP_InertialSensor_MPU6000::_has_auxiliary_bus() @@ -344,7 +344,7 @@ bool AP_InertialSensor_MPU6000::_has_auxiliary_bus()
void AP_InertialSensor_MPU6000::start()
{
if (!_dev->get_semaphore()->take(100)) {
if (!_dev->get_semaphore()->take(0)) {
AP_HAL::panic("MPU6000: Unable to get semaphore");
}
@ -722,7 +722,7 @@ bool AP_InertialSensor_MPU6000::_check_whoami(void) @@ -722,7 +722,7 @@ bool AP_InertialSensor_MPU6000::_check_whoami(void)
bool AP_InertialSensor_MPU6000::_hardware_init(void)
{
if (!_dev->get_semaphore()->take(100)) {
if (!_dev->get_semaphore()->take(0)) {
AP_HAL::panic("MPU6000: Unable to get semaphore");
}
@ -803,7 +803,7 @@ bool AP_InertialSensor_MPU6000::_hardware_init(void) @@ -803,7 +803,7 @@ bool AP_InertialSensor_MPU6000::_hardware_init(void)
void AP_InertialSensor_MPU6000::_dump_registers(void)
{
hal.console->println("MPU6000 registers");
if (!_dev->get_semaphore()->take(100)) {
if (!_dev->get_semaphore()->take(0)) {
return;
}

4
libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp

@ -295,7 +295,7 @@ bool AP_InertialSensor_MPU9250::_has_auxiliary_bus() @@ -295,7 +295,7 @@ bool AP_InertialSensor_MPU9250::_has_auxiliary_bus()
void AP_InertialSensor_MPU9250::start()
{
if (!_dev->get_semaphore()->take(100)) {
if (!_dev->get_semaphore()->take(0)) {
AP_HAL::panic("MPU92500: Unable to get semaphore");
}
@ -600,7 +600,7 @@ void AP_InertialSensor_MPU9250::_register_write(uint8_t reg, uint8_t val, bool c @@ -600,7 +600,7 @@ void AP_InertialSensor_MPU9250::_register_write(uint8_t reg, uint8_t val, bool c
bool AP_InertialSensor_MPU9250::_hardware_init(void)
{
if (!_dev->get_semaphore()->take(100)) {
if (!_dev->get_semaphore()->take(0)) {
AP_HAL::panic("MPU9250: Unable to get semaphore");
}

Loading…
Cancel
Save