diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2013-12-11 16:57:19 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2013-12-11 16:58:11 +0100 |
commit | c033443208666d6972d99fe5a7b8e0c3fa5050b5 (patch) | |
tree | b87421fc0842fe433300357406b3dbcf21efb41d /src/modules | |
parent | b69097df387ed6cea65d9884f6b3bc2ecb3ce3d9 (diff) | |
download | px4-firmware-c033443208666d6972d99fe5a7b8e0c3fa5050b5.tar.gz px4-firmware-c033443208666d6972d99fe5a7b8e0c3fa5050b5.tar.bz2 px4-firmware-c033443208666d6972d99fe5a7b8e0c3fa5050b5.zip |
px4iofirmware: improve check for rc controlled channels in manual mode
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/px4iofirmware/mixer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/px4iofirmware/mixer.cpp b/src/modules/px4iofirmware/mixer.cpp index fdf01e09c..9fc86db5e 100644 --- a/src/modules/px4iofirmware/mixer.cpp +++ b/src/modules/px4iofirmware/mixer.cpp @@ -258,7 +258,7 @@ mixer_callback(uintptr_t handle, return -1; case MIX_OVERRIDE: - if ((r_page_rc_input[PX4IO_P_RC_VALID] & (1 << control_index)) && CONTROL_PAGE_INDEX(control_group, control_index) < PX4IO_RC_INPUT_CHANNELS) { + if (r_page_rc_input[PX4IO_P_RC_VALID] & (1 << CONTROL_PAGE_INDEX(control_group, control_index))) { control = REG_TO_FLOAT(r_page_rc_input[PX4IO_P_RC_BASE + control_index]); break; } @@ -266,7 +266,7 @@ mixer_callback(uintptr_t handle, case MIX_OVERRIDE_FMU_OK: /* FMU is ok but we are in override mode, use direct rc control for the available rc channels. The remaining channels are still controlled by the fmu */ - if ((r_page_rc_input[PX4IO_P_RC_VALID] & (1 << control_index)) && CONTROL_PAGE_INDEX(control_group, control_index) < PX4IO_RC_INPUT_CHANNELS) { + if (r_page_rc_input[PX4IO_P_RC_VALID] & (1 << CONTROL_PAGE_INDEX(control_group, control_index))) { control = REG_TO_FLOAT(r_page_rc_input[PX4IO_P_RC_BASE + control_index]); break; } else if (control_index < PX4IO_CONTROL_CHANNELS && control_group < PX4IO_CONTROL_GROUPS) { |