rc/dsm: decode improvements

- always check system field for validity
 - reject any data outside of "servo position" valid range from Spektrum specification
 - properly support XPlus channels (12+)
 - debug message if channel count changes
This commit is contained in:
Daniel Agar
2020-08-02 12:52:16 -04:00
committed by GitHub
parent 1191a0efe6
commit 63a23957b1
7 changed files with 168 additions and 64 deletions

View File

@@ -38,7 +38,7 @@
using namespace time_literals;
#if defined(SPEKTRUM_POWER)
static bool bind_spektrum(int arg);
static bool bind_spektrum(int arg = DSMX8_BIND_PULSES);
#endif /* SPEKTRUM_POWER */
constexpr char const *RCInput::RC_SCAN_STRING[];
@@ -652,7 +652,8 @@ int RCInput::custom_command(int argc, char *argv[])
const char *verb = argv[0];
if (!strcmp(verb, "bind")) {
bind_spektrum(DSMX8_BIND_PULSES);
// TODO: publish vehicle_command
bind_spektrum();
return 0;
}