|
|
|
@ -71,7 +71,7 @@ using namespace time_literals;
@@ -71,7 +71,7 @@ using namespace time_literals;
|
|
|
|
|
#include "flashparams/flashparams.h" |
|
|
|
|
static const char *param_default_file = nullptr; // nullptr means to store to FLASH
|
|
|
|
|
#else |
|
|
|
|
inline static int flash_param_save(bool only_unsaved) { return -1; } |
|
|
|
|
inline static int flash_param_save(bool only_unsaved, param_filter_func filter) { return -1; } |
|
|
|
|
inline static int flash_param_load() { return -1; } |
|
|
|
|
inline static int flash_param_import() { return -1; } |
|
|
|
|
static const char *param_default_file = PX4_ROOTFSDIR"/eeprom/parameters"; |
|
|
|
@ -948,7 +948,7 @@ int param_save_default()
@@ -948,7 +948,7 @@ int param_save_default()
|
|
|
|
|
if (!filename) { |
|
|
|
|
perf_begin(param_export_perf); |
|
|
|
|
param_lock_writer(); |
|
|
|
|
res = flash_param_save(false); |
|
|
|
|
res = flash_param_save(false, nullptr); |
|
|
|
|
param_unlock_writer(); |
|
|
|
|
perf_end(param_export_perf); |
|
|
|
|
return res; |
|
|
|
@ -976,7 +976,7 @@ int param_save_default()
@@ -976,7 +976,7 @@ int param_save_default()
|
|
|
|
|
int attempts = 5; |
|
|
|
|
|
|
|
|
|
while (res != OK && attempts > 0) { |
|
|
|
|
res = param_export(fd, false); |
|
|
|
|
res = param_export(fd, false, nullptr); |
|
|
|
|
attempts--; |
|
|
|
|
|
|
|
|
|
if (res != PX4_OK) { |
|
|
|
@ -1035,7 +1035,7 @@ param_load_default()
@@ -1035,7 +1035,7 @@ param_load_default()
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int |
|
|
|
|
param_export(int fd, bool only_unsaved) |
|
|
|
|
param_export(int fd, bool only_unsaved, param_filter_func filter) |
|
|
|
|
{ |
|
|
|
|
int result = -1; |
|
|
|
|
perf_begin(param_export_perf); |
|
|
|
@ -1043,7 +1043,7 @@ param_export(int fd, bool only_unsaved)
@@ -1043,7 +1043,7 @@ param_export(int fd, bool only_unsaved)
|
|
|
|
|
if (fd < 0) { |
|
|
|
|
param_lock_writer(); |
|
|
|
|
// flash_param_save() will take the shutdown lock
|
|
|
|
|
result = flash_param_save(only_unsaved); |
|
|
|
|
result = flash_param_save(only_unsaved, filter); |
|
|
|
|
param_unlock_writer(); |
|
|
|
|
perf_end(param_export_perf); |
|
|
|
|
return result; |
|
|
|
@ -1081,6 +1081,10 @@ param_export(int fd, bool only_unsaved)
@@ -1081,6 +1081,10 @@ param_export(int fd, bool only_unsaved)
|
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (filter && !filter(s->param)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
s->unsaved = false; |
|
|
|
|
|
|
|
|
|
const char *name = param_name(s->param); |
|
|
|
|