diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-25 12:53:58 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-25 12:53:58 +0200 |
commit | c7ecafe99b6c6c567d9bd8ac223d5e20592644bc (patch) | |
tree | 64b404dbaf62e584d110659eb58a4d29576c58e5 /src | |
parent | 7e8177890835c03de76d75e737d75291c659bbf3 (diff) | |
download | px4-firmware-c7ecafe99b6c6c567d9bd8ac223d5e20592644bc.tar.gz px4-firmware-c7ecafe99b6c6c567d9bd8ac223d5e20592644bc.tar.bz2 px4-firmware-c7ecafe99b6c6c567d9bd8ac223d5e20592644bc.zip |
commander: Critical fix for arm state machine. Only auto-save if not stored already
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/commander/commander.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index d67f184ce..5e0346155 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -2763,8 +2763,6 @@ void *commander_low_prio_loop(void *arg) // Update preflight check status status.condition_system_sensors_initialized = Commander::preflightCheck(mavlink_fd, true, true, true, true, checkAirspeed, true); - arming_state_transition(&status, &safety, vehicle_status_s::ARMING_STATE_STANDBY, &armed, true /* fRunPreArmChecks */, mavlink_fd); - if (((int)(cmd.param1)) == 0) { int ret = param_load_default(); @@ -2788,9 +2786,15 @@ void *commander_low_prio_loop(void *arg) } } else if (((int)(cmd.param1)) == 1) { + int ret = param_save_default(); if (ret == OK) { + if (need_param_autosave) { + need_param_autosave = false; + need_param_autosave_timeout = 0; + } + mavlink_log_info(mavlink_fd, "settings saved"); answer_command(cmd, VEHICLE_CMD_RESULT_ACCEPTED); |