Browse Source

AP_BoardConfig: wait up to 0.4s for safety to be off on boot

mission-4.1.18
Andrew Tridgell 9 years ago
parent
commit
119e312cd3
  1. 6
      libraries/AP_BoardConfig/px4_drivers.cpp

6
libraries/AP_BoardConfig/px4_drivers.cpp

@ -146,6 +146,12 @@ void AP_BoardConfig::px4_setup_safety() @@ -146,6 +146,12 @@ void AP_BoardConfig::px4_setup_safety()
if (px4.safety_enable.get() == 0) {
hal.rcout->force_safety_off();
hal.rcout->force_safety_no_wait();
// wait until safety has been turned off
uint8_t count = 20;
while (hal.util->safety_switch_state() != AP_HAL::Util::SAFETY_ARMED && count--) {
hal.scheduler->delay(20);
}
}
}

Loading…
Cancel
Save