mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-15 22:10:36 +08:00
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:
@@ -320,6 +320,13 @@ RCUpdate::Run()
|
||||
|
||||
if (_input_rc_sub.copy(&rc_input)) {
|
||||
|
||||
// warn if the channel count is changing (possibly indication of error)
|
||||
if (!rc_input.rc_lost && (_channel_count_previous != rc_input.channel_count) && (_channel_count_previous > 0)) {
|
||||
PX4_DEBUG("RC channel count changed %d -> %d", _channel_count_previous, rc_input.channel_count);
|
||||
}
|
||||
|
||||
_channel_count_previous = rc_input.channel_count;
|
||||
|
||||
/* detect RC signal loss */
|
||||
bool signal_lost = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user