From 8e1acb10fd1925e900e76d58d7f1abd0e4b3c6ee Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 1 Dec 2024 11:43:23 +1100 Subject: [PATCH] Filter: enable 4 filters on low-flash boards --- libraries/Filter/AP_Filter_config.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libraries/Filter/AP_Filter_config.h b/libraries/Filter/AP_Filter_config.h index d94dd9df1b..d89e7a0a62 100644 --- a/libraries/Filter/AP_Filter_config.h +++ b/libraries/Filter/AP_Filter_config.h @@ -2,14 +2,16 @@ #include -#ifndef AP_FILTER_NUM_FILTERS -#if BOARD_FLASH_SIZE > 1024 -#define AP_FILTER_NUM_FILTERS 8 -#else -#define AP_FILTER_NUM_FILTERS 0 -#endif +#ifndef AP_FILTER_ENABLED +#define AP_FILTER_ENABLED BOARD_FLASH_SIZE > 1024 #endif -#ifndef AP_FILTER_ENABLED -#define AP_FILTER_ENABLED AP_FILTER_NUM_FILTERS > 0 -#endif +#if AP_FILTER_ENABLED + #ifndef AP_FILTER_NUM_FILTERS + #if BOARD_FLASH_SIZE > 1024 + #define AP_FILTER_NUM_FILTERS 8 + #else + #define AP_FILTER_NUM_FILTERS 4 + #endif // BOARD_FLASH_SIZE + #endif // AP_FILTER_NUM_FILTERS +#endif // AP_FILTER_ENABLED