AP_Arming: make AP_RANGEFINDER_ENABLED remove more code

This commit is contained in:
Peter Barker 2023-11-08 09:23:39 +11:00 committed by Andrew Tridgell
parent dabc34e7de
commit 955245e4b7
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}