AP_RCProtocol: allow for fport without FRSky telem

This commit is contained in:
Andrew Tridgell 2023-08-06 14:15:48 +10:00 committed by Peter Barker
parent ca549e1887
commit 24139d661a
3 changed files with 4 additions and 2 deletions

View File

@ -103,7 +103,7 @@ void AP_RCProtocol_FPort::decode_control(const FPort_Frame &frame)
*/ */
void AP_RCProtocol_FPort::decode_downlink(const FPort_Frame &frame) void AP_RCProtocol_FPort::decode_downlink(const FPort_Frame &frame)
{ {
#if !APM_BUILD_TYPE(APM_BUILD_iofirmware) #if !APM_BUILD_TYPE(APM_BUILD_iofirmware) && AP_FRSKY_SPORT_TELEM_ENABLED
switch (frame.downlink.prim) { switch (frame.downlink.prim) {
case FPORT_PRIM_DATA: case FPORT_PRIM_DATA:
// we've seen at least one 0x10 frame // we've seen at least one 0x10 frame

View File

@ -53,10 +53,12 @@ private:
const bool inverted; const bool inverted;
#if AP_FRSKY_SPORT_TELEM_ENABLED
struct { struct {
bool available = false; bool available = false;
AP_Frsky_SPort::sport_packet_t packet; AP_Frsky_SPort::sport_packet_t packet;
} telem_data; } telem_data;
#endif // AP_FRSKY_SPORT_TELEM_ENABLED
// receiver sends 0x10 when ready to receive telemetry frames (R-XSR) // receiver sends 0x10 when ready to receive telemetry frames (R-XSR)
bool rx_driven_frame_rate = false; bool rx_driven_frame_rate = false;

View File

@ -20,7 +20,7 @@
#endif #endif
#ifndef AP_RCPROTOCOL_FPORT_ENABLED #ifndef AP_RCPROTOCOL_FPORT_ENABLED
#define AP_RCPROTOCOL_FPORT_ENABLED AP_RCPROTOCOL_BACKEND_DEFAULT_ENABLED && AP_FRSKY_SPORT_TELEM_ENABLED #define AP_RCPROTOCOL_FPORT_ENABLED AP_RCPROTOCOL_BACKEND_DEFAULT_ENABLED
#endif #endif
#ifndef AP_RCPROTOCOL_FPORT2_ENABLED #ifndef AP_RCPROTOCOL_FPORT2_ENABLED
#define AP_RCPROTOCOL_FPORT2_ENABLED AP_RCPROTOCOL_BACKEND_DEFAULT_ENABLED && AP_FRSKY_SPORT_TELEM_ENABLED #define AP_RCPROTOCOL_FPORT2_ENABLED AP_RCPROTOCOL_BACKEND_DEFAULT_ENABLED && AP_FRSKY_SPORT_TELEM_ENABLED