commander: use arm_disarm() helper for safety button disarm

This commit is contained in:
Daniel Agar 2020-01-20 13:19:32 -05:00 committed by Lorenz Meier
parent 624fcc3adb
commit 4f868fc565
1 changed files with 1 additions and 4 deletions

View File

@ -1434,10 +1434,7 @@ Commander::run()
if (armed.armed && (status.hil_state == vehicle_status_s::HIL_STATE_OFF)
&& _safety.safety_switch_available && !_safety.safety_off) {
if (TRANSITION_CHANGED == arming_state_transition(&status, _safety, vehicle_status_s::ARMING_STATE_STANDBY,
&armed, true /* fRunPreArmChecks */, &mavlink_log_pub,
&status_flags, _arm_requirements, hrt_elapsed_time(&_boot_timestamp))
) {
if (TRANSITION_CHANGED == arm_disarm(false, true, &mavlink_log_pub, "Safety button")) {
_status_changed = true;
}
}