From b4d36707af9f2750df5c4f1109e8b57b4068dcce Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 27 Jun 2022 17:07:48 +1000 Subject: [PATCH] AP_HAL: use minimize_features.inc for HAL_WITH_DSP --- libraries/AP_HAL/AP_HAL_Boards.h | 11 ++++++----- libraries/AP_HAL/board/linux.h | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) 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