AP_Mount: Make use of the new AP_Mount_Alexmos backend

This is adding AP_Mount_Alexmos as one of the available backend
This commit is contained in:
Matthias Badaire 2015-01-15 23:47:59 +01:00 committed by Andrew Tridgell
parent dfc086f9e9
commit 6e5e438b0f
2 changed files with 10 additions and 1 deletions

View File

@ -7,6 +7,7 @@
#include <AP_Mount_Backend.h>
#include <AP_Mount_Servo.h>
#include <AP_Mount_MAVLink.h>
#include <AP_Mount_Alexmos.h>
const AP_Param::GroupInfo AP_Mount::var_info[] PROGMEM = {
// @Param: _DEFLT_MODE
@ -193,7 +194,7 @@ const AP_Param::GroupInfo AP_Mount::var_info[] PROGMEM = {
// @Param: _TYPE
// @DisplayName: Mount Type
// @Description: Mount Type (None, Servo or MAVLink)
// @Values: 0:None, 1:Servo, 2:MAVLink
// @Values: 0:None, 1:Servo, 2:MAVLink 3:Alexmos Serial
// @User: Standard
AP_GROUPINFO("_TYPE", 19, AP_Mount, state[0]._type, 0),
@ -420,6 +421,11 @@ void AP_Mount::init()
} else if (mount_type == Mount_Type_MAVLink) {
_backends[instance] = new AP_Mount_MAVLink(*this, instance);
_num_instances++;
// check for MAVLink mounts
} else if (mount_type == Mount_Type_Alexmos) {
_backends[instance] = new AP_Mount_Alexmos(*this, instance);
_num_instances++;
}
// init new instance

View File

@ -36,6 +36,7 @@
class AP_Mount_Backend;
class AP_Mount_Servo;
class AP_Mount_MAVLink;
class AP_Mount_Alexmos;
class AP_Mount
{
@ -43,6 +44,7 @@ class AP_Mount
friend class AP_Mount_Backend;
friend class AP_Mount_Servo;
friend class AP_Mount_MAVLink;
friend class AP_Mount_Alexmos;
public:
@ -51,6 +53,7 @@ public:
Mount_Type_None = 0, /// no mount
Mount_Type_Servo = 1, /// servo controlled mount
Mount_Type_MAVLink = 2, /// MAVLink controlled mount
Mount_Type_Alexmos = 2, /// MAVLink controlled mount
};
// Constructor