AP_Mount: add HAL_MOUNT_STORM32MAVLINK_ENABLED build option

This commit is contained in:
Randy Mackay 2022-06-14 13:55:37 +09:00 committed by Andrew Tridgell
parent 4f0ee1276b
commit 59916d0327
3 changed files with 11 additions and 4 deletions

View File

@ -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) {

View File

@ -1,5 +1,6 @@
#include "AP_Mount_SToRM32.h"
#if HAL_MOUNT_ENABLED
#if HAL_MOUNT_STORM32MAVLINK_ENABLED
#include <AP_HAL/AP_HAL.h>
#include <GCS_MAVLink/GCS.h>
@ -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

View File

@ -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 <AP_Math/AP_Math.h>
#include <AP_Common/AP_Common.h>
@ -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