Browse Source

AP_RCProtocol: use switch statement for 3-frame check

Forces new protocol implementer to consider whether a 3-frame check is
required
gps-1.3.1
Peter Barker 3 years ago committed by Peter Barker
parent
commit
63f87a863c
  1. 19
      libraries/AP_RCProtocol/AP_RCProtocol.h

19
libraries/AP_RCProtocol/AP_RCProtocol.h

@ -62,7 +62,24 @@ public: @@ -62,7 +62,24 @@ public:
// for protocols without strong CRCs we require 3 good frames to lock on
bool requires_3_frames(enum rcprotocol_t p) {
return (p == DSM || p == SBUS || p == SBUS_NI || p == PPM || p == FPORT || p == FPORT2);
switch (p) {
case DSM:
case SBUS:
case SBUS_NI:
case PPM:
case FPORT:
case FPORT2:
return true;
case IBUS:
case SUMD:
case SRXL:
case SRXL2:
case CRSF:
case ST24:
case NONE:
return false;
}
return false;
}
uint8_t num_channels();

Loading…
Cancel
Save