mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-26 02:40:34 +08:00
param: implement rate-limited autosave
- add a saving delay of 300ms - save at most once every 2 seconds
This commit is contained in:
@@ -281,7 +281,7 @@ param_import_callback(bson_decoder_t decoder, void *private, bson_node_t node)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (param_set_external(param, v, state->mark_saved, true, false)) {
|
||||
if (param_set_external(param, v, state->mark_saved, true)) {
|
||||
|
||||
debug("error setting value for '%s'", node->name);
|
||||
goto out;
|
||||
|
||||
@@ -61,7 +61,7 @@ __BEGIN_DECLS
|
||||
#define FLASH_PARAMS_EXPOSE __EXPORT
|
||||
|
||||
__EXPORT extern UT_array *param_values;
|
||||
__EXPORT int param_set_external(param_t param, const void *val, bool mark_saved, bool notify_changes, bool is_saved);
|
||||
__EXPORT int param_set_external(param_t param, const void *val, bool mark_saved, bool notify_changes);
|
||||
__EXPORT const void *param_get_value_ptr_external(param_t param);
|
||||
|
||||
/* The interface hooks to the Flash based storage. The caller is responsible for locking */
|
||||
|
||||
Reference in New Issue
Block a user