diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-05-15 14:35:49 +0200 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-05-15 14:35:49 +0200 |
commit | 8d1df9ba87ee152ca35ddbfa94924b868db62d64 (patch) | |
tree | 4a4ccee6ebd53af79986d613e9df0841e1f959f6 /src/modules/px4iofirmware/controls.c | |
parent | bc3ca8db5646cf2a2e235cf7ca3bd62335e062c2 (diff) | |
parent | c72ec3fd5fc934e0aae08d605058c36858d9fd3e (diff) | |
download | px4-firmware-8d1df9ba87ee152ca35ddbfa94924b868db62d64.tar.gz px4-firmware-8d1df9ba87ee152ca35ddbfa94924b868db62d64.tar.bz2 px4-firmware-8d1df9ba87ee152ca35ddbfa94924b868db62d64.zip |
Merge branch 'master' into mc_mixer_fix
Diffstat (limited to 'src/modules/px4iofirmware/controls.c')
-rw-r--r-- | src/modules/px4iofirmware/controls.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/modules/px4iofirmware/controls.c b/src/modules/px4iofirmware/controls.c index 56c5aa005..62e6b12cb 100644 --- a/src/modules/px4iofirmware/controls.c +++ b/src/modules/px4iofirmware/controls.c @@ -291,6 +291,7 @@ controls_tick() { /* set RC OK flag, as we got an update */ r_status_flags |= PX4IO_P_STATUS_FLAGS_RC_OK; + r_raw_rc_flags |= PX4IO_P_RAW_RC_FLAGS_RC_OK; /* if we have enough channels (5) to control the vehicle, the mapping is ok */ if (assigned_channels > 4) { @@ -336,6 +337,9 @@ controls_tick() { PX4IO_P_STATUS_FLAGS_OVERRIDE | PX4IO_P_STATUS_FLAGS_RC_OK); + /* flag raw RC as lost */ + r_raw_rc_flags &= ~(PX4IO_P_RAW_RC_FLAGS_RC_OK); + /* Mark all channels as invalid, as we just lost the RX */ r_rc_valid = 0; @@ -405,8 +409,9 @@ ppm_input(uint16_t *values, uint16_t *num_values, uint16_t *frame_len) if (*num_values > PX4IO_RC_INPUT_CHANNELS) *num_values = PX4IO_RC_INPUT_CHANNELS; - for (unsigned i = 0; i < *num_values; i++) + for (unsigned i = 0; i < *num_values; i++) { values[i] = ppm_buffer[i]; + } /* clear validity */ ppm_last_valid_decode = 0; |