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