mirror of https://github.com/ArduPilot/ardupilot
SRV_Channel: support SBusOut
This commit is contained in:
parent
94d4f068a8
commit
cca251c135
|
@ -152,7 +152,7 @@ void AP_SBusOut::init() {
|
|||
uint16_t rate = sbus_rate.get();
|
||||
|
||||
#if SBUS_DEBUG
|
||||
::printf("AP_SBusOut: init %d Hz\n", rate);
|
||||
hal.console->printf("AP_SBusOut: init %d Hz\n", rate);
|
||||
#endif
|
||||
|
||||
// subtract 500msec from requested frame interval to allow for latency
|
||||
|
|
|
@ -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_SBusOut/AP_SBusOut.h>
|
||||
|
||||
#define NUM_SERVO_CHANNELS 16
|
||||
|
||||
|
@ -440,6 +441,10 @@ private:
|
|||
AP_Volz_Protocol volz = AP_Volz_Protocol::create();
|
||||
static AP_Volz_Protocol *volz_ptr;
|
||||
|
||||
// support for SBUS protocol
|
||||
AP_SBusOut sbus = AP_SBusOut::create();
|
||||
static AP_SBusOut *sbus_ptr;
|
||||
|
||||
SRV_Channel obj_channels[NUM_SERVO_CHANNELS];
|
||||
|
||||
static struct srv_function {
|
||||
|
|
|
@ -27,6 +27,7 @@ extern const AP_HAL::HAL& hal;
|
|||
SRV_Channel *SRV_Channels::channels;
|
||||
SRV_Channels *SRV_Channels::instance;
|
||||
AP_Volz_Protocol *SRV_Channels::volz_ptr;
|
||||
AP_SBusOut *SRV_Channels::sbus_ptr;
|
||||
|
||||
bool SRV_Channels::disabled_passthrough;
|
||||
bool SRV_Channels::initialised;
|
||||
|
@ -117,6 +118,10 @@ const AP_Param::GroupInfo SRV_Channels::var_info[] = {
|
|||
// @Path: ../AP_Volz_Protocol/AP_Volz_Protocol.cpp
|
||||
AP_SUBGROUPINFO(volz, "_VOLZ_", 19, SRV_Channels, AP_Volz_Protocol),
|
||||
|
||||
// @Group: SBUS_
|
||||
// @Path: ../AP_SBusOut/AP_SBusOut.cpp
|
||||
AP_SUBGROUPINFO(sbus, "_SBUS_", 20, SRV_Channels, AP_SBusOut),
|
||||
|
||||
AP_GROUPEND
|
||||
};
|
||||
|
||||
|
@ -137,6 +142,7 @@ SRV_Channels::SRV_Channels(void)
|
|||
}
|
||||
|
||||
volz_ptr = &volz;
|
||||
sbus_ptr = &sbus;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -201,4 +207,7 @@ void SRV_Channels::push()
|
|||
|
||||
// give volz library a chance to update
|
||||
volz_ptr->update();
|
||||
|
||||
// give sbus library a chance to update
|
||||
sbus_ptr->update();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue