Mount: integrate SToRM32 backend

This commit is contained in:
Randy Mackay 2015-02-14 21:27:58 +09:00
parent 92c7949355
commit 23f0bab5d6
2 changed files with 12 additions and 3 deletions

View File

@ -8,6 +8,7 @@
#include <AP_Mount_Servo.h>
#include <AP_Mount_MAVLink.h>
#include <AP_Mount_Alexmos.h>
#include <AP_Mount_SToRM32.h>
const AP_Param::GroupInfo AP_Mount::var_info[] PROGMEM = {
// @Param: _DEFLT_MODE
@ -194,7 +195,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, 3:Alexmos Serial
// @Values: 0:None, 1:Servo, 2:MAVLink, 3:Alexmos Serial, 4:SToRM32
// @User: Standard
AP_GROUPINFO("_TYPE", 19, AP_Mount, state[0]._type, 0),
@ -377,7 +378,7 @@ const AP_Param::GroupInfo AP_Mount::var_info[] PROGMEM = {
// @Param: 2_TYPE
// @DisplayName: Mount2 Type
// @Description: Mount Type (None, Servo or MAVLink)
// @Values: 0:None, 1:Servo, 2:MAVLink, 3:Alexmos Serial
// @Values: 0:None, 1:Servo, 2:MAVLink, 3:Alexmos Serial, 4:SToRM32
// @User: Standard
AP_GROUPINFO("2_TYPE", 42, AP_Mount, state[1]._type, 0),
#endif // AP_MOUNT_MAX_INSTANCES > 1
@ -431,6 +432,11 @@ void AP_Mount::init(const AP_SerialManager& serial_manager)
} else if (mount_type == Mount_Type_Alexmos) {
_backends[instance] = new AP_Mount_Alexmos(*this, state[instance], instance);
_num_instances++;
// check for SToRM32 mounts
} else if (mount_type == Mount_Type_SToRM32) {
_backends[instance] = new AP_Mount_SToRM32(*this, state[instance], instance);
_num_instances++;
}
// init new instance

View File

@ -38,6 +38,7 @@ class AP_Mount_Backend;
class AP_Mount_Servo;
class AP_Mount_MAVLink;
class AP_Mount_Alexmos;
class AP_Mount_SToRM32;
/*
This is a workaround to allow the MAVLink backend access to the
@ -56,6 +57,7 @@ class AP_Mount
friend class AP_Mount_Servo;
friend class AP_Mount_MAVLink;
friend class AP_Mount_Alexmos;
friend class AP_Mount_SToRM32;
public:
@ -64,7 +66,8 @@ public:
Mount_Type_None = 0, /// no mount
Mount_Type_Servo = 1, /// servo controlled mount
Mount_Type_MAVLink = 2, /// MAVLink controlled mount
Mount_Type_Alexmos = 3 /// MAVLink controlled mount
Mount_Type_Alexmos = 3, /// Alexmos mount
Mount_Type_SToRM32 = 4 /// SToRM32 mount
};
// Constructor