Copter: sonar pre-arm check only if optflow enabled

This commit is contained in:
Randy Mackay 2015-06-16 17:58:22 +09:00
parent 43d6060ba7
commit 5e40ad5c38

View File

@ -513,9 +513,9 @@ bool Copter::pre_arm_checks(bool display_failure)
return false; return false;
} }
#if CONFIG_SONAR == ENABLED #if CONFIG_SONAR == ENABLED && OPTFLOW == ENABLED
// check range finder // check range finder if optflow enabled
if (!sonar.pre_arm_check()) { if (optflow.enabled() && !sonar.pre_arm_check()) {
if (display_failure) { if (display_failure) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: check range finder")); gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: check range finder"));
} }