Skip to content

Commit 1412cb3

Browse files
committed
Sub:add aux func disarm to pre-arm check for disarm function
1 parent a5d7f03 commit 1412cb3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ArduSub/AP_Arming_Sub.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ bool AP_Arming_Sub::has_disarm_function() const {
3838
}
3939
}
4040
}
41+
// check if an AUX function that disarms or estops is setup
42+
if (rc().find_channel_for_option(RC_Channel::AUX_FUNC::MOTOR_ESTOP) ||
43+
rc().find_channel_for_option(RC_Channel::AUX_FUNC::ARMDISARM) ||
44+
rc().find_channel_for_option(RC_Channel::AUX_FUNC::ARM_EMERGENCY_STOP)) {
45+
return true;
46+
}
4147
return false;
4248
}
4349

@@ -48,7 +54,7 @@ bool AP_Arming_Sub::pre_arm_checks(bool display_failure)
4854
}
4955
// don't allow arming unless there is a disarm button configured
5056
if (!has_disarm_function()) {
51-
check_failed(display_failure, "Must assign a disarm or arm_toggle button");
57+
check_failed(display_failure, "Must assign a disarm or arm_toggle button or disarm aux function");
5258
return false;
5359
}
5460

0 commit comments

Comments
 (0)