Skip to content

Commit

Permalink
commander: Critical fix for arm state machine. Only auto-save if not …
Browse files Browse the repository at this point in the history
…stored already
  • Loading branch information
LorenzMeier committed Apr 25, 2015
1 parent 7e81778 commit c7ecafe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/commander/commander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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);

Expand Down

0 comments on commit c7ecafe

Please sign in to comment.