aboutsummaryrefslogtreecommitdiff
path: root/apps/px4io/comms.c
diff options
context:
space:
mode:
authorSimon Wilks <sjwilks@gmail.com>2013-01-06 04:21:04 +0100
committerSimon Wilks <sjwilks@gmail.com>2013-01-06 04:21:04 +0100
commit7842caf3b2d5686c4e909d7d7f28758119e8918f (patch)
treebb0b773138ea9997543ef7c98a6433c4e19ba408 /apps/px4io/comms.c
parent0a89ab7075e4d637c91e21246c4790599f046aec (diff)
downloadpx4-firmware-7842caf3b2d5686c4e909d7d7f28758119e8918f.tar.gz
px4-firmware-7842caf3b2d5686c4e909d7d7f28758119e8918f.tar.bz2
px4-firmware-7842caf3b2d5686c4e909d7d7f28758119e8918f.zip
Moved the channel mappings and attributes to the config section
Diffstat (limited to 'apps/px4io/comms.c')
-rw-r--r--apps/px4io/comms.c27
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