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
This commit is contained in:
Peter Barker 2023-11-21 14:15:44 +11:00 committed by Peter Barker
parent e806adb009
commit 8eb5baa4ae
3 changed files with 15 additions and 9 deletions

View File

@ -1,10 +1,12 @@
#include "AP_Filter_config.h"
#if AP_FILTER_ENABLED
#include "AP_Filter.h"
#include <AP_BoardConfig/AP_BoardConfig.h>
#include <AP_Vehicle/AP_Vehicle_Type.h>
#include <AP_HAL/AP_HAL_Boards.h>
#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

View File

@ -1,9 +1,11 @@
#include "AP_Filter_config.h"
#if AP_FILTER_ENABLED
#include "AP_Filter.h"
#include <AP_Vehicle/AP_Vehicle_Type.h>
#include <AP_BoardConfig/AP_BoardConfig.h>
#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

View File

@ -1,9 +1,11 @@
#include "AP_Filter_config.h"
#if AP_FILTER_ENABLED
#include "AP_Filter.h"
#include <AP_Vehicle/AP_Vehicle_Type.h>
#include <AP_BoardConfig/AP_BoardConfig.h>
#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