From e2106e63bf794c7a8145474a334ffc332d97c9a8 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 14 Jun 2022 13:54:57 +0900 Subject: [PATCH] AP_Mount: add HAL_MOUNT_ALEXMOS_ENABLED build option --- libraries/AP_Mount/AP_Mount.cpp | 2 ++ libraries/AP_Mount/AP_Mount_Alexmos.cpp | 6 +++--- libraries/AP_Mount/AP_Mount_Alexmos.h | 13 ++++++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/libraries/AP_Mount/AP_Mount.cpp b/libraries/AP_Mount/AP_Mount.cpp index ee94daa455..9ae07b70dc 100644 --- a/libraries/AP_Mount/AP_Mount.cpp +++ b/libraries/AP_Mount/AP_Mount.cpp @@ -453,10 +453,12 @@ void AP_Mount::init() _num_instances++; #endif // HAL_SOLO_GIMBAL_ENABLED +#if HAL_MOUNT_ALEXMOS_ENABLED // check for Alexmos mounts } else if (mount_type == Mount_Type_Alexmos) { _backends[instance] = new AP_Mount_Alexmos(*this, state[instance], instance); _num_instances++; +#endif // check for SToRM32 mounts using MAVLink protocol } else if (mount_type == Mount_Type_SToRM32) { diff --git a/libraries/AP_Mount/AP_Mount_Alexmos.cpp b/libraries/AP_Mount/AP_Mount_Alexmos.cpp index 6252a7819c..a02564e6ef 100644 --- a/libraries/AP_Mount/AP_Mount_Alexmos.cpp +++ b/libraries/AP_Mount/AP_Mount_Alexmos.cpp @@ -1,7 +1,7 @@ #include "AP_Mount_Alexmos.h" -#if HAL_MOUNT_ENABLED -#include +#if HAL_MOUNT_ALEXMOS_ENABLED +#include #include extern const AP_HAL::HAL& hal; @@ -307,4 +307,4 @@ void AP_Mount_Alexmos::read_incoming() } } } -#endif // HAL_MOUNT_ENABLED +#endif // HAL_MOUNT_ALEXMOS_ENABLED diff --git a/libraries/AP_Mount/AP_Mount_Alexmos.h b/libraries/AP_Mount/AP_Mount_Alexmos.h index 20f1c35299..3396176e26 100644 --- a/libraries/AP_Mount/AP_Mount_Alexmos.h +++ b/libraries/AP_Mount/AP_Mount_Alexmos.h @@ -3,13 +3,16 @@ */ #pragma once -#include "AP_Mount.h" -#if HAL_MOUNT_ENABLED +#include "AP_Mount_Backend.h" + +#ifndef HAL_MOUNT_ALEXMOS_ENABLED +#define HAL_MOUNT_ALEXMOS_ENABLED HAL_MOUNT_ENABLED +#endif + +#if HAL_MOUNT_ALEXMOS_ENABLED #include #include #include -#include "AP_Mount_Backend.h" - //definition of the commands id for the Alexmos Serial Protocol #define CMD_READ_PARAMS 'R' @@ -299,4 +302,4 @@ private: // confirmed that last command was ok bool _last_command_confirmed : 1; }; -#endif // HAL_MOUNT_ENABLED +#endif // HAL_MOUNT_ALEXMOS_ENABLED