diff --git a/libraries/AP_Mount/AP_Mount.cpp b/libraries/AP_Mount/AP_Mount.cpp index f6d8a45688..b6096f9528 100644 --- a/libraries/AP_Mount/AP_Mount.cpp +++ b/libraries/AP_Mount/AP_Mount.cpp @@ -462,10 +462,12 @@ void AP_Mount::init() _num_instances++; #endif +#if HAL_MOUNT_STORM32MAVLINK_ENABLED // check for SToRM32 mounts using MAVLink protocol } else if (mount_type == Mount_Type_SToRM32) { _backends[instance] = new AP_Mount_SToRM32(*this, state[instance], instance); _num_instances++; +#endif // check for SToRM32 mounts using serial protocol } else if (mount_type == Mount_Type_SToRM32_serial) { diff --git a/libraries/AP_Mount/AP_Mount_SToRM32.cpp b/libraries/AP_Mount/AP_Mount_SToRM32.cpp index 6e542cdec8..742561c4db 100644 --- a/libraries/AP_Mount/AP_Mount_SToRM32.cpp +++ b/libraries/AP_Mount/AP_Mount_SToRM32.cpp @@ -1,5 +1,6 @@ #include "AP_Mount_SToRM32.h" -#if HAL_MOUNT_ENABLED + +#if HAL_MOUNT_STORM32MAVLINK_ENABLED #include #include @@ -172,4 +173,4 @@ void AP_Mount_SToRM32::send_do_mount_control(float pitch_deg, float roll_deg, fl // store time of send _last_send = AP_HAL::millis(); } -#endif // HAL_MOUNT_ENABLED +#endif // HAL_MOUNT_STORM32MAVLINK_ENABLED diff --git a/libraries/AP_Mount/AP_Mount_SToRM32.h b/libraries/AP_Mount/AP_Mount_SToRM32.h index 573c93e309..4f17392c70 100644 --- a/libraries/AP_Mount/AP_Mount_SToRM32.h +++ b/libraries/AP_Mount/AP_Mount_SToRM32.h @@ -5,7 +5,11 @@ #include "AP_Mount_Backend.h" -#if HAL_MOUNT_ENABLED +#ifndef HAL_MOUNT_STORM32MAVLINK_ENABLED +#define HAL_MOUNT_STORM32MAVLINK_ENABLED HAL_MOUNT_ENABLED +#endif + +#if HAL_MOUNT_STORM32MAVLINK_ENABLED #include #include @@ -49,4 +53,4 @@ private: mavlink_channel_t _chan; // mavlink channel used to communicate with gimbal uint32_t _last_send; // system time of last do_mount_control sent to gimbal }; -#endif // HAL_MOUNT_ENABLED +#endif // HAL_MOUNT_STORM32MAVLINK_ENABLED