aboutsummaryrefslogtreecommitdiff
path: root/apps/px4io/comms.c
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-12-15 23:28:03 +0100
committerLorenz Meier <lm@inf.ethz.ch>2012-12-15 23:28:03 +0100
commitf81d00594c156c51ab976d3b6d101915377d7afa (patch)
tree041ff3b3d54ca5c2f7a995eadcbc2e58af1e56ba /apps/px4io/comms.c
parent42ffb4161d4cec9e1d290d0191e7a4bb89546ed9 (diff)
downloadpx4-firmware-f81d00594c156c51ab976d3b6d101915377d7afa.tar.gz
px4-firmware-f81d00594c156c51ab976d3b6d101915377d7afa.tar.bz2
px4-firmware-f81d00594c156c51ab976d3b6d101915377d7afa.zip
Made PX4IO FMU timeout based on IOs HRT, updating mixers now on every FMU update and not at fixed rate, this is WIP and currently does not support mixing with RC-only
Diffstat (limited to 'apps/px4io/comms.c')
-rw-r--r--apps/px4io/comms.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/px4io/comms.c b/apps/px4io/comms.c
index 0fcf952ab..9a786234e 100644
--- a/apps/px4io/comms.c
+++ b/apps/px4io/comms.c
@@ -183,7 +183,7 @@ comms_handle_command(const void *buffer, size_t length)
system_state.vector_flight_mode_ok = cmd->vector_flight_mode_ok;
system_state.manual_override_ok = cmd->manual_override_ok;
system_state.mixer_fmu_available = true;
- system_state.fmu_data_received = true;
+ system_state.fmu_data_received_time = hrt_absolute_time();
/* set PWM update rate if changed (after limiting) */
uint16_t new_servo_rate = cmd->servo_rate;
@@ -201,6 +201,9 @@ comms_handle_command(const void *buffer, size_t length)
system_state.servo_rate = new_servo_rate;
}
+ /* update servo values immediately */
+ mixer_tick();
+
/* XXX do relay changes here */
for (unsigned i = 0; i < PX4IO_RELAY_CHANNELS; i++) {
system_state.relays[i] = cmd->relay_state[i];