From 709656c49dd7fc8ad41dd71bfb65621f9551ec01 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 9 Jan 2024 17:30:56 +1100 Subject: [PATCH] AP_Arming: remove entire airspeed_checks if AP_AIRSPEED_ENABLED is off saves bytes and removes some redundant code which is obscured when the ifdefs are inside the body --- libraries/AP_Arming/AP_Arming.cpp | 6 ++---- libraries/AP_Arming/AP_Arming.h | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index 1153490b7a..ff6362b688 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -303,9 +303,9 @@ bool AP_Arming::barometer_checks(bool report) return true; } +#if AP_AIRSPEED_ENABLED bool AP_Arming::airspeed_checks(bool report) { -#if AP_AIRSPEED_ENABLED if (check_enabled(ARMING_CHECK_AIRSPEED)) { const AP_Airspeed *airspeed = AP_Airspeed::get_singleton(); if (airspeed == nullptr) { @@ -319,10 +319,10 @@ bool AP_Arming::airspeed_checks(bool report) } } } -#endif return true; } +#endif // AP_AIRSPEED_ENABLED #if HAL_LOGGING_ENABLED bool AP_Arming::logging_checks(bool report) @@ -1199,8 +1199,6 @@ bool AP_Arming::proximity_checks(bool report) const return false; } return true; - - return true; } #endif // HAL_PROXIMITY_ENABLED diff --git a/libraries/AP_Arming/AP_Arming.h b/libraries/AP_Arming/AP_Arming.h index 7569227da8..8f46bd47e9 100644 --- a/libraries/AP_Arming/AP_Arming.h +++ b/libraries/AP_Arming/AP_Arming.h @@ -236,8 +236,6 @@ protected: bool fettec_checks(bool display_failure) const; - bool kdecan_checks(bool display_failure) const; - #if HAL_PROXIMITY_ENABLED virtual bool proximity_checks(bool report) const; #endif