diff options
Diffstat (limited to 'apps/px4io/comms.c')
-rw-r--r-- | apps/px4io/comms.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/apps/px4io/comms.c b/apps/px4io/comms.c index 2733877a2..85da65767 100644 --- a/apps/px4io/comms.c +++ b/apps/px4io/comms.c @@ -162,6 +162,20 @@ comms_handle_config(const void *buffer, size_t length) } frame_rx++; + + /* fetch the rc mappings */ + for (unsigned i = 0; i < 4; i++) { + system_state.rc_map[i] = cfg->rc_map[i]; + } + + /* fetch the rc channel attributes */ + for (unsigned i = 0; i < 4; i++) { + system_state.rc_min[i] = cfg->rc_min[i]; + system_state.rc_trim[i] = cfg->rc_trim[i]; + system_state.rc_max[i] = cfg->rc_max[i]; + system_state.rc_rev[i] = cfg->rc_rev[i]; + system_state.rc_dz[i] = cfg->rc_dz[i]; + } } static void @@ -207,19 +221,6 @@ comms_handle_command(const void *buffer, size_t length) system_state.servo_rate = new_servo_rate; } - /* fetch the rc mappings */ - for (unsigned i = 0; i < 4; i++) - system_state.rc_map[i] = cmd->rc_map[i]; - - /* fetch the rc channel attributes */ - for (unsigned i = 0; i < 4; i++) { - system_state.rc_min[i] = cmd->rc_min[i]; - system_state.rc_trim[i] = cmd->rc_trim[i]; - system_state.rc_max[i] = cmd->rc_max[i]; - system_state.rc_rev[i] = cmd->rc_rev[i]; - system_state.rc_dz[i] = cmd->rc_dz[i]; - } - /* * update servo values immediately. * the updates are done in addition also |