aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-10-07 22:24:32 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-10-07 22:24:32 +0200
commit6436db1a99888aff3802008c91f8a6c151f7da9c (patch)
treeb74538061bfaf37430f874c64a4cc429f400cfa5
parent7e5910bdbf10c5c00f438d17d1b0bcd00d6c020d (diff)
downloadpx4-firmware-6436db1a99888aff3802008c91f8a6c151f7da9c.tar.gz
px4-firmware-6436db1a99888aff3802008c91f8a6c151f7da9c.tar.bz2
px4-firmware-6436db1a99888aff3802008c91f8a6c151f7da9c.zip
Fix parser return type handling
-rw-r--r--src/modules/px4iofirmware/controls.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/modules/px4iofirmware/controls.c b/src/modules/px4iofirmware/controls.c
index 8670e30c2..622f20c7d 100644
--- a/src/modules/px4iofirmware/controls.c
+++ b/src/modules/px4iofirmware/controls.c
@@ -83,15 +83,14 @@ bool dsm_port_input(uint8_t *rssi, bool *dsm_updated, bool *st24_updated)
/* get data from FD and attempt to parse with DSM and ST24 libs */
uint8_t st24_rssi, rx_count;
- uint16_t st24_channel_count;
- uint8_t st24_maxchans = 18;
+ uint16_t st24_channel_count = 0;
*st24_updated = false;
for (unsigned i = 0; i < n_bytes; i++) {
/* set updated flag if one complete packet was parsed */
- *st24_updated |= st24_decode(bytes[i], &st24_rssi, &rx_count,
- &st24_channel_count, r_raw_rc_values, st24_maxchans);
+ *st24_updated |= (OK == st24_decode(bytes[i], &st24_rssi, &rx_count,
+ &st24_channel_count, r_raw_rc_values, PX4IO_RC_INPUT_CHANNELS));
}
if (*st24_updated) {