aboutsummaryrefslogtreecommitdiff
path: root/apps/px4io/comms.c
diff options
context:
space:
mode:
authorJulian Oes <joes@student.ethz.ch>2012-11-06 19:03:08 -0800
committerJulian Oes <joes@student.ethz.ch>2012-11-06 19:03:08 -0800
commit74f76006029ad6b209c1a409e8e35044b1c53bbb (patch)
tree9266ab3e8fd3fb51ef91a0970cc2b476fe46c2ee /apps/px4io/comms.c
parent7da799d154f6f3c5f0c1a92cbad4288f83c90650 (diff)
downloadpx4-firmware-74f76006029ad6b209c1a409e8e35044b1c53bbb.tar.gz
px4-firmware-74f76006029ad6b209c1a409e8e35044b1c53bbb.tar.bz2
px4-firmware-74f76006029ad6b209c1a409e8e35044b1c53bbb.zip
Again some hacking to make arming/disarming work for now
Diffstat (limited to 'apps/px4io/comms.c')
-rw-r--r--apps/px4io/comms.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/px4io/comms.c b/apps/px4io/comms.c
index 1edff25b1..0a0453b55 100644
--- a/apps/px4io/comms.c
+++ b/apps/px4io/comms.c
@@ -148,13 +148,19 @@ comms_handle_command(const void *buffer, size_t length)
for (unsigned i = 0; i < PX4IO_OUTPUT_CHANNELS; i++)
system_state.fmu_channel_data[i] = cmd->servo_command[i];
+ /* if the IO is armed and the FMU gets disarmed, the IO must also disarm */
+ if(system_state.arm_ok && !cmd->arm_ok) {
+ system_state.armed = false;
+ }
+
system_state.arm_ok = cmd->arm_ok;
system_state.mixer_use_fmu = true;
system_state.fmu_data_received = true;
+
/* handle changes signalled by FMU */
- if (!system_state.arm_ok && system_state.armed)
- system_state.armed = false;
+// if (!system_state.arm_ok && system_state.armed)
+// system_state.armed = false;
/* XXX do relay changes here */
for (unsigned i = 0; i < PX4IO_RELAY_CHANNELS; i++)