Plane: remove bogus ARMING_CHECK_NONE 'bitmask value'

This commit is contained in:
Peter Barker 2019-10-05 07:51:32 +10:00 committed by Andrew Tridgell
parent d42c66afcc
commit 3ccf215066

View File

@ -20,7 +20,7 @@ const AP_Param::GroupInfo AP_Arming_Plane::var_info[] = {
bool AP_Arming_Plane::pre_arm_checks(bool display_failure)
{
//are arming checks disabled?
if (checks_to_perform == ARMING_CHECK_NONE) {
if (checks_to_perform == 0) {
return true;
}
if (hal.util->was_watchdog_armed()) {
@ -38,22 +38,22 @@ bool AP_Arming_Plane::pre_arm_checks(bool display_failure)
ret &= AP_Arming::airspeed_checks(display_failure);
if (plane.g.fs_timeout_long < plane.g.fs_timeout_short && plane.g.fs_action_short != FS_ACTION_SHORT_DISABLED) {
check_failed(ARMING_CHECK_NONE, display_failure, "FS_LONG_TIMEOUT < FS_SHORT_TIMEOUT");
check_failed(display_failure, "FS_LONG_TIMEOUT < FS_SHORT_TIMEOUT");
ret = false;
}
if (plane.aparm.roll_limit_cd < 300) {
check_failed(ARMING_CHECK_NONE, display_failure, "LIM_ROLL_CD too small (%u)", (unsigned)plane.aparm.roll_limit_cd);
check_failed(display_failure, "LIM_ROLL_CD too small (%u)", (unsigned)plane.aparm.roll_limit_cd);
ret = false;
}
if (plane.aparm.pitch_limit_max_cd < 300) {
check_failed(ARMING_CHECK_NONE, display_failure, "LIM_PITCH_MAX too small (%u)", (unsigned)plane.aparm.pitch_limit_max_cd);
check_failed(display_failure, "LIM_PITCH_MAX too small (%u)", (unsigned)plane.aparm.pitch_limit_max_cd);
ret = false;
}
if (plane.aparm.pitch_limit_min_cd > -300) {
check_failed(ARMING_CHECK_NONE, display_failure, "LIM_PITCH_MIN too large (%u)", (unsigned)plane.aparm.pitch_limit_min_cd);
check_failed(display_failure, "LIM_PITCH_MIN too large (%u)", (unsigned)plane.aparm.pitch_limit_min_cd);
ret = false;
}
@ -61,17 +61,17 @@ bool AP_Arming_Plane::pre_arm_checks(bool display_failure)
plane.g.throttle_fs_enabled &&
plane.g.throttle_fs_value <
plane.channel_throttle->get_radio_max()) {
check_failed(ARMING_CHECK_NONE, display_failure, "Invalid THR_FS_VALUE for rev throttle");
check_failed(display_failure, "Invalid THR_FS_VALUE for rev throttle");
ret = false;
}
if (plane.quadplane.enabled() && !plane.quadplane.available()) {
check_failed(ARMING_CHECK_NONE, display_failure, "Quadplane enabled but not running");
check_failed(display_failure, "Quadplane enabled but not running");
ret = false;
}
if (plane.quadplane.available() && plane.scheduler.get_loop_rate_hz() < 100) {
check_failed(ARMING_CHECK_NONE, display_failure, "quadplane needs SCHED_LOOP_RATE >= 100");
check_failed(display_failure, "quadplane needs SCHED_LOOP_RATE >= 100");
ret = false;
}
@ -89,18 +89,18 @@ bool AP_Arming_Plane::pre_arm_checks(bool display_failure)
}
if (plane.control_mode == &plane.mode_auto && plane.mission.num_commands() <= 1) {
check_failed(ARMING_CHECK_NONE, display_failure, "No mission loaded");
check_failed(display_failure, "No mission loaded");
ret = false;
}
// check adsb avoidance failsafe
if (plane.failsafe.adsb) {
check_failed(ARMING_CHECK_NONE, display_failure, "ADSB threat detected");
check_failed(display_failure, "ADSB threat detected");
ret = false;
}
if (SRV_Channels::get_emergency_stop()) {
check_failed(ARMING_CHECK_NONE, display_failure,"Motors Emergency Stopped");
check_failed(display_failure,"Motors Emergency Stopped");
ret = false;
}
@ -133,7 +133,7 @@ bool AP_Arming_Plane::ins_checks(bool display_failure)
bool AP_Arming_Plane::arm_checks(AP_Arming::Method method)
{
//are arming checks disabled?
if (checks_to_perform == ARMING_CHECK_NONE) {
if (checks_to_perform == 0) {
return true;
}