diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-12-01 10:49:52 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-12-01 10:49:52 +0100 |
commit | de88732e8ecdf1f8451c8c037594f4edb1e2bdc0 (patch) | |
tree | af6d877598c23ce8f64be56362a8e7964477a9ce /apps/px4io | |
parent | ea8872f5456dbba566fb4167ec66b4afa183b3e1 (diff) | |
download | px4-firmware-de88732e8ecdf1f8451c8c037594f4edb1e2bdc0.tar.gz px4-firmware-de88732e8ecdf1f8451c8c037594f4edb1e2bdc0.tar.bz2 px4-firmware-de88732e8ecdf1f8451c8c037594f4edb1e2bdc0.zip |
Prevented unhealthy RC input from propagating through the system
Diffstat (limited to 'apps/px4io')
-rw-r--r-- | apps/px4io/comms.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/px4io/comms.c b/apps/px4io/comms.c index 375336730..40ea38cf7 100644 --- a/apps/px4io/comms.c +++ b/apps/px4io/comms.c @@ -132,7 +132,13 @@ comms_main(void) /* populate the report */ for (int i = 0; i < system_state.rc_channels; i++) report.rc_channel[i] = system_state.rc_channel_data[i]; - report.channel_count = system_state.rc_channels; + + if (system_state.sbus_input_ok || system_state.dsm_input_ok || system_state.ppm_input_ok) { + report.channel_count = system_state.rc_channels; + } else { + report.channel_count = 0; + } + report.armed = system_state.armed; /* and send it */ |