aboutsummaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-12-27 21:19:04 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-12-27 21:19:04 +0100
commita9ea39054dbd6eb62fb3185465848a485c32a046 (patch)
treee3fd89fe2cdaa6ecefb4751446c35ec1fb250e8d /src/drivers
parentcddbb0d23fc21d4b1c0d9b734dd98447fc814ad9 (diff)
downloadpx4-firmware-a9ea39054dbd6eb62fb3185465848a485c32a046.tar.gz
px4-firmware-a9ea39054dbd6eb62fb3185465848a485c32a046.tar.bz2
px4-firmware-a9ea39054dbd6eb62fb3185465848a485c32a046.zip
Working around creating an error condition with more than 8 raw RC channels
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/px4io/px4io.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp
index 9812ea497..22d707233 100644
--- a/src/drivers/px4io/px4io.cpp
+++ b/src/drivers/px4io/px4io.cpp
@@ -1095,8 +1095,10 @@ PX4IO::io_set_rc_config()
* assign RC_MAP_ROLL/PITCH/YAW/THROTTLE to the canonical
* controls.
*/
+
+ /* fill the mapping with an error condition triggering value */
for (unsigned i = 0; i < _max_rc_input; i++)
- input_map[i] = -1;
+ input_map[i] = UINT16_MAX;
/*
* NOTE: The indices for mapped channels are 1-based
@@ -1128,12 +1130,6 @@ PX4IO::io_set_rc_config()
if ((ichan >= 0) && (ichan < (int)_max_rc_input))
input_map[ichan - 1] = 4;
- ichan = 5;
-
- for (unsigned i = 0; i < _max_rc_input; i++)
- if (input_map[i] == -1)
- input_map[i] = ichan++;
-
/*
* Iterate all possible RC inputs.
*/