diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index dabe449715..9c4dee7f22 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -916,6 +916,7 @@ bool AP_Arming::mission_checks(bool report) bool AP_Arming::rangefinder_checks(bool report) { +#if AP_RANGEFINDER_ENABLED if (check_enabled(ARMING_CHECK_RANGEFINDER)) { RangeFinder *range = RangeFinder::get_singleton(); if (range == nullptr) { @@ -928,6 +929,7 @@ bool AP_Arming::rangefinder_checks(bool report) return false; } } +#endif return true; }