From 8eb5baa4ae060dcada5ee76b5024df9f83d213ff Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 21 Nov 2023 14:15:44 +1100 Subject: [PATCH] Filter: correct AP_Filter defines - checking the build type is very rarely used and definitely not required here - fix boilerplate to conform to normal pattern of including the config header and #if'ing based on the _ENABLED directly after that --- libraries/Filter/AP_Filter.cpp | 8 +++++--- libraries/Filter/AP_Filter_params.cpp | 8 +++++--- libraries/Filter/AP_NotchFilter_params.cpp | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/libraries/Filter/AP_Filter.cpp b/libraries/Filter/AP_Filter.cpp index ce65bd61ff..3e2763141a 100644 --- a/libraries/Filter/AP_Filter.cpp +++ b/libraries/Filter/AP_Filter.cpp @@ -1,10 +1,12 @@ +#include "AP_Filter_config.h" + +#if AP_FILTER_ENABLED + #include "AP_Filter.h" #include #include #include -#if AP_FILTER_ENABLED && !APM_BUILD_TYPE(APM_BUILD_AP_Periph) - extern const AP_HAL::HAL& hal; const AP_Param::GroupInfo AP_Filters::var_info[] = { @@ -152,4 +154,4 @@ AP_Filters &filters() } -#endif // AP_FILTER_ENABLED && !APM_BUILD_TYPE(APM_BUILD_AP_Periph) +#endif // AP_FILTER_ENABLED diff --git a/libraries/Filter/AP_Filter_params.cpp b/libraries/Filter/AP_Filter_params.cpp index d13cb2477f..40412bae85 100644 --- a/libraries/Filter/AP_Filter_params.cpp +++ b/libraries/Filter/AP_Filter_params.cpp @@ -1,9 +1,11 @@ +#include "AP_Filter_config.h" + +#if AP_FILTER_ENABLED + #include "AP_Filter.h" #include #include -#if AP_FILTER_ENABLED && !APM_BUILD_TYPE(APM_BUILD_AP_Periph) - const AP_Param::GroupInfo AP_Filter_params::var_info[] = { // @Param: TYPE @@ -22,4 +24,4 @@ AP_Filter_params::AP_Filter_params() AP_Param::setup_object_defaults(this, var_info); } -#endif // AP_FILTER_ENABLED && !APM_BUILD_TYPE(APM_BUILD_AP_Periph) +#endif // AP_FILTER_ENABLED diff --git a/libraries/Filter/AP_NotchFilter_params.cpp b/libraries/Filter/AP_NotchFilter_params.cpp index 5927fef445..68769765dd 100644 --- a/libraries/Filter/AP_NotchFilter_params.cpp +++ b/libraries/Filter/AP_NotchFilter_params.cpp @@ -1,9 +1,11 @@ +#include "AP_Filter_config.h" + +#if AP_FILTER_ENABLED + #include "AP_Filter.h" #include #include -#if AP_FILTER_ENABLED && !APM_BUILD_TYPE(APM_BUILD_AP_Periph) - const AP_Param::GroupInfo AP_NotchFilter_params::var_info[] = { // @Param: NOTCH_FREQ @@ -50,4 +52,4 @@ bool AP_NotchFilter_params::setup_notch_filter(NotchFilterFloat& filter, float s return true; } -#endif // AP_FILTER_ENABLED && !APM_BUILD_TYPE(APM_BUILD_AP_Periph) +#endif // AP_FILTER_ENABLED