AP_Mount: add HAL_MOUNT_ALEXMOS_ENABLED build option

This commit is contained in:
Randy Mackay 2022-06-14 13:54:57 +09:00 committed by Andrew Tridgell
parent 8f51e28242
commit e2106e63bf
3 changed files with 13 additions and 8 deletions

View File

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

View File

@ -1,7 +1,7 @@
#include "AP_Mount_Alexmos.h"
#if HAL_MOUNT_ENABLED
#include <AP_SerialManager/AP_SerialManager.h>
#if HAL_MOUNT_ALEXMOS_ENABLED
#include <AP_SerialManager/AP_SerialManager.h>
#include <AP_AHRS/AP_AHRS.h>
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

View File

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