AP_RCProtocol: add CRSF binding API
This commit is contained in:
parent
cd6ed219f7
commit
2f246b7638
@ -680,6 +680,17 @@ int16_t AP_RCProtocol_CRSF::derive_scaled_lq_value(uint8_t uplink_lq)
|
||||
return int16_t(roundf(constrain_float(uplink_lq*2.5f,0,255)));
|
||||
}
|
||||
|
||||
// start bind
|
||||
#if HAL_CRSF_TELEM_ENABLED
|
||||
void AP_RCProtocol_CRSF::start_bind(void)
|
||||
{
|
||||
AP_CRSF_Telem* telem = AP::crsf_telem();
|
||||
if (telem != nullptr) {
|
||||
telem->start_bind();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace AP {
|
||||
AP_RCProtocol_CRSF* crsf() {
|
||||
return AP_RCProtocol_CRSF::get_singleton();
|
||||
|
@ -19,6 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "AP_RCProtocol_config.h"
|
||||
#include <AP_RCTelemetry/AP_RCTelemetry_config.h>
|
||||
|
||||
#if AP_RCPROTOCOL_CRSF_ENABLED
|
||||
|
||||
@ -43,6 +44,9 @@ public:
|
||||
void process_byte(uint8_t byte, uint32_t baudrate) override;
|
||||
void process_handshake(uint32_t baudrate) override;
|
||||
void update(void) override;
|
||||
#if HAL_CRSF_TELEM_ENABLED
|
||||
void start_bind(void) override;
|
||||
#endif
|
||||
// support for CRSF v3
|
||||
bool change_baud_rate(uint32_t baudrate);
|
||||
// bootstrap baudrate
|
||||
@ -149,6 +153,8 @@ public:
|
||||
// Commands for CRSF_COMMAND_RX
|
||||
enum CommandRX {
|
||||
CRSF_COMMAND_RX_BIND = 0x01,
|
||||
CRSF_COMMAND_RX_CANCEL_BIND = 0x02,
|
||||
CRSF_COMMAND_RX_SET_BIND_ID = 0x03,
|
||||
};
|
||||
|
||||
// Commands for CRSF_COMMAND_GENERAL
|
||||
|
Loading…
Reference in New Issue
Block a user