diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-02-12 09:20:11 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-02-12 09:20:11 +0100 |
commit | 857fe5d405312508439a91493802e58e547d7940 (patch) | |
tree | c79f1da17234e0be2ca50891d705a98c5eca2304 /apps/px4io/registers.c | |
parent | ef301890bae6cb63980931d731ac10af72a00bb4 (diff) | |
download | px4-firmware-857fe5d405312508439a91493802e58e547d7940.tar.gz px4-firmware-857fe5d405312508439a91493802e58e547d7940.tar.bz2 px4-firmware-857fe5d405312508439a91493802e58e547d7940.zip |
Fixes to RC config transmission from Simon Wilks
Diffstat (limited to 'apps/px4io/registers.c')
-rw-r--r-- | apps/px4io/registers.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/px4io/registers.c b/apps/px4io/registers.c index 3824c64b0..815563daa 100644 --- a/apps/px4io/registers.c +++ b/apps/px4io/registers.c @@ -339,7 +339,7 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value) case PX4IO_PAGE_RC_CONFIG: { unsigned channel = offset / PX4IO_P_RC_CONFIG_STRIDE; - unsigned index = offset % PX4IO_P_RC_CONFIG_STRIDE; + unsigned index = offset - channel * PX4IO_P_RC_CONFIG_STRIDE; uint16_t *conf = &r_page_rc_input_config[channel * PX4IO_P_RC_CONFIG_STRIDE]; if (channel >= MAX_CONTROL_CHANNELS) @@ -390,8 +390,11 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value) conf[index] |= PX4IO_P_RC_CONFIG_OPTIONS_ENABLED; } break; + /* inner switch: case PX4IO_P_RC_CONFIG_OPTIONS */ } + break; + /* case PX4IO_RC_PAGE_CONFIG */ } default: |