mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 08:51:35 +08:00
Commander: Do not save params on already saved param update
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
uint64 timestamp # time at which the latest parameter was updated
|
uint64 timestamp # time at which the latest parameter was updated
|
||||||
|
bool saved # wether the change has already been saved to disk
|
||||||
|
|||||||
@@ -1509,12 +1509,12 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
/* EPH / EPV */
|
/* EPH / EPV */
|
||||||
param_get(_param_eph, &eph_threshold);
|
param_get(_param_eph, &eph_threshold);
|
||||||
param_get(_param_epv, &epv_threshold);
|
param_get(_param_epv, &epv_threshold);
|
||||||
}
|
|
||||||
|
|
||||||
/* Set flag to autosave parameters if necessary */
|
/* Set flag to autosave parameters if necessary */
|
||||||
if (updated && autosave_params != 0) {
|
if (updated && autosave_params != 0 && param_changed.saved == false) {
|
||||||
/* trigger an autosave */
|
/* trigger an autosave */
|
||||||
need_param_autosave = true;
|
need_param_autosave = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
orb_check(sp_man_sub, &updated);
|
orb_check(sp_man_sub, &updated);
|
||||||
@@ -1570,11 +1570,12 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
/* and the system is not already armed (and potentially flying) */
|
/* and the system is not already armed (and potentially flying) */
|
||||||
!armed.armed) {
|
!armed.armed) {
|
||||||
|
|
||||||
bool chAirspeed = false;
|
bool chAirspeed = false;
|
||||||
bool hotplug_timeout = hrt_elapsed_time(&commander_boot_timestamp) > HOTPLUG_SENS_TIMEOUT;
|
bool hotplug_timeout = hrt_elapsed_time(&commander_boot_timestamp) > HOTPLUG_SENS_TIMEOUT;
|
||||||
|
|
||||||
/* Perform airspeed check only if circuit breaker is not
|
/* Perform airspeed check only if circuit breaker is not
|
||||||
* engaged and it's not a rotary wing */
|
* engaged and it's not a rotary wing
|
||||||
|
*/
|
||||||
if (!status.circuit_breaker_engaged_airspd_check && !status.is_rotary_wing) {
|
if (!status.circuit_breaker_engaged_airspd_check && !status.is_rotary_wing) {
|
||||||
chAirspeed = true;
|
chAirspeed = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user