diff --git a/libraries/AP_HAL/AP_HAL_Boards.h b/libraries/AP_HAL/AP_HAL_Boards.h index e45e5e77b4..2a48a24b13 100644 --- a/libraries/AP_HAL/AP_HAL_Boards.h +++ b/libraries/AP_HAL/AP_HAL_Boards.h @@ -184,12 +184,13 @@ #define BOARD_FLASH_SIZE 2048 #endif -#ifndef HAL_WITH_DSP -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || defined(HAL_BOOTLOADER_BUILD) || defined(HAL_BUILD_AP_PERIPH) || BOARD_FLASH_SIZE <= 1024 -#define HAL_WITH_DSP 0 -#else -#define HAL_WITH_DSP !HAL_MINIMIZE_FEATURES +#ifndef HAL_GYROFFT_ENABLED +#define HAL_GYROFFT_ENABLED (BOARD_FLASH_SIZE > 1024) #endif + +// enable AP_GyroFFT library only if required: +#ifndef HAL_WITH_DSP +#define HAL_WITH_DSP HAL_GYROFFT_ENABLED #endif #ifndef HAL_OS_FATFS_IO diff --git a/libraries/AP_HAL/board/linux.h b/libraries/AP_HAL/board/linux.h index 1bbdcddd5f..c36205d737 100644 --- a/libraries/AP_HAL/board/linux.h +++ b/libraries/AP_HAL/board/linux.h @@ -392,3 +392,7 @@ #ifndef HAL_WITH_EKF_DOUBLE #define HAL_WITH_EKF_DOUBLE HAL_HAVE_HARDWARE_DOUBLE #endif + +#ifndef HAL_GYROFFT_ENABLED +#define HAL_GYROFFT_ENABLED 0 +#endif