Browse Source

SRV_Channel: added RobotisServo protocol support

master
Andrew Tridgell 6 years ago
parent
commit
d72f6598e0
  1. 5
      libraries/SRV_Channel/SRV_Channel.h
  2. 9
      libraries/SRV_Channel/SRV_Channels.cpp

5
libraries/SRV_Channel/SRV_Channel.h

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
#include <AP_RCMapper/AP_RCMapper.h>
#include <AP_Common/Bitmask.h>
#include <AP_Volz_Protocol/AP_Volz_Protocol.h>
#include <AP_RobotisServo/AP_RobotisServo.h>
#include <AP_SBusOut/AP_SBusOut.h>
#include <AP_BLHeli/AP_BLHeli.h>
@ -480,6 +481,10 @@ private: @@ -480,6 +481,10 @@ private:
AP_SBusOut sbus;
static AP_SBusOut *sbus_ptr;
// support for Robotis servo protocol
AP_RobotisServo robotis;
static AP_RobotisServo *robotis_ptr;
#if HAL_SUPPORT_RCOUT_SERIAL
// support for BLHeli protocol
AP_BLHeli blheli;

9
libraries/SRV_Channel/SRV_Channels.cpp

@ -33,6 +33,7 @@ SRV_Channel *SRV_Channels::channels; @@ -33,6 +33,7 @@ SRV_Channel *SRV_Channels::channels;
SRV_Channels *SRV_Channels::instance;
AP_Volz_Protocol *SRV_Channels::volz_ptr;
AP_SBusOut *SRV_Channels::sbus_ptr;
AP_RobotisServo *SRV_Channels::robotis_ptr;
#if HAL_SUPPORT_RCOUT_SERIAL
AP_BLHeli *SRV_Channels::blheli_ptr;
@ -141,6 +142,10 @@ const AP_Param::GroupInfo SRV_Channels::var_info[] = { @@ -141,6 +142,10 @@ const AP_Param::GroupInfo SRV_Channels::var_info[] = {
AP_SUBGROUPINFO(blheli, "_BLH_", 21, SRV_Channels, AP_BLHeli),
#endif
// @Group: _ROB_
// @Path: ../AP_RobotisServo/AP_RobotisServo.cpp
AP_SUBGROUPINFO(robotis, "_ROB_", 22, SRV_Channels, AP_RobotisServo),
AP_GROUPEND
};
@ -162,6 +167,7 @@ SRV_Channels::SRV_Channels(void) @@ -162,6 +167,7 @@ SRV_Channels::SRV_Channels(void)
volz_ptr = &volz;
sbus_ptr = &sbus;
robotis_ptr = &robotis;
#if HAL_SUPPORT_RCOUT_SERIAL
blheli_ptr = &blheli;
#endif
@ -228,6 +234,9 @@ void SRV_Channels::push() @@ -228,6 +234,9 @@ void SRV_Channels::push()
// give sbus library a chance to update
sbus_ptr->update();
// give robotis library a chance to update
robotis_ptr->update();
#if HAL_SUPPORT_RCOUT_SERIAL
// give blheli telemetry a chance to update
blheli_ptr->update_telemetry();

Loading…
Cancel
Save