From 6436db1a99888aff3802008c91f8a6c151f7da9c Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 7 Oct 2014 22:24:32 +0200 Subject: Fix parser return type handling --- src/modules/px4iofirmware/controls.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/modules/px4iofirmware/controls.c') 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) { -- cgit v1.2.3