mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-05 05:48:53 +08:00
Param command: Auto-save after set
This commit is contained in:
@@ -448,7 +448,7 @@ do_set(const char *name, const char *val, bool fail_on_not_found)
|
||||
param_value_unsaved(param) ? '*' : (param_value_is_default(param) ? ' ' : '+'),
|
||||
param_name(param));
|
||||
printf("curr: %ld", (long)i);
|
||||
param_set(param, &newval);
|
||||
param_set_no_autosave(param, &newval);
|
||||
printf(" -> new: %ld\n", (long)newval);
|
||||
}
|
||||
}
|
||||
@@ -470,7 +470,7 @@ do_set(const char *name, const char *val, bool fail_on_not_found)
|
||||
param_value_unsaved(param) ? '*' : (param_value_is_default(param) ? ' ' : '+'),
|
||||
param_name(param));
|
||||
printf("curr: %4.4f", (double)f);
|
||||
param_set(param, &newval);
|
||||
param_set_no_autosave(param, &newval);
|
||||
printf(" -> new: %4.4f\n", (double)newval);
|
||||
}
|
||||
|
||||
@@ -483,7 +483,13 @@ do_set(const char *name, const char *val, bool fail_on_not_found)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (param_save_default()) {
|
||||
warnx("Param export failed.");
|
||||
return 1;
|
||||
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user