From 3eb9515aafd92bf86a417bd9b6fbc993773ec2c7 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 11 Mar 2023 13:20:58 +1100 Subject: [PATCH] AP_EF: correct builds when AP_EFI_ENABLED is false dronecan backend was not checking for HAL_EFI_ENABLED --- libraries/AP_EFI/AP_EFI_DroneCAN.h | 4 ---- libraries/AP_EFI/AP_EFI_config.h | 12 ++++++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libraries/AP_EFI/AP_EFI_DroneCAN.h b/libraries/AP_EFI/AP_EFI_DroneCAN.h index 35c02d5e37..d1ec432ccc 100644 --- a/libraries/AP_EFI/AP_EFI_DroneCAN.h +++ b/libraries/AP_EFI/AP_EFI_DroneCAN.h @@ -3,10 +3,6 @@ #include "AP_EFI.h" #include "AP_EFI_Backend.h" -#ifndef HAL_EFI_DRONECAN_ENABLED -#define HAL_EFI_DRONECAN_ENABLED HAL_MAX_CAN_PROTOCOL_DRIVERS && BOARD_FLASH_SIZE > 1024 && HAL_CANMANAGER_ENABLED -#endif - #if HAL_EFI_DRONECAN_ENABLED #include #include diff --git a/libraries/AP_EFI/AP_EFI_config.h b/libraries/AP_EFI/AP_EFI_config.h index 37669582f6..c85584373a 100644 --- a/libraries/AP_EFI/AP_EFI_config.h +++ b/libraries/AP_EFI/AP_EFI_config.h @@ -6,6 +6,14 @@ #define HAL_EFI_ENABLED !HAL_MINIMIZE_FEATURES && BOARD_FLASH_SIZE > 1024 #endif -#ifndef AP_EFI_SCRIPTING_ENABLED -#define AP_EFI_SCRIPTING_ENABLED (HAL_EFI_ENABLED && AP_SCRIPTING_ENABLED) +#ifndef AP_EFI_BACKEND_DEFAULT_ENABLED +#define AP_EFI_BACKEND_DEFAULT_ENABLED HAL_EFI_ENABLED +#endif + +#ifndef HAL_EFI_DRONECAN_ENABLED +#define HAL_EFI_DRONECAN_ENABLED AP_EFI_BACKEND_DEFAULT_ENABLED && HAL_MAX_CAN_PROTOCOL_DRIVERS && BOARD_FLASH_SIZE > 1024 && HAL_CANMANAGER_ENABLED +#endif + +#ifndef AP_EFI_SCRIPTING_ENABLED +#define AP_EFI_SCRIPTING_ENABLED (AP_EFI_BACKEND_DEFAULT_ENABLED && AP_SCRIPTING_ENABLED) #endif