params: add possibility to access files if flash-based params are enabled

- the flash-backend is selected by specifying nullptr as file or -1 as fd
- the default file is nullptr, and thus the FLASH
- 'param select' has no effect, FLASH is always the default

Thus there should be no functional change to existing setups.
This commit is contained in:
Beat Küng
2018-12-23 15:49:37 -05:00
committed by Daniel Agar
parent 2698625be9
commit 5b4a77a67b
5 changed files with 84 additions and 67 deletions
@@ -353,9 +353,9 @@ out:
return result;
}
int flash_param_save()
int flash_param_save(bool only_unsaved)
{
return param_export_internal(false);
return param_export_internal(only_unsaved);
}
int flash_param_load()
@@ -366,5 +366,5 @@ int flash_param_load()
int flash_param_import()
{
return -1;
return param_import_internal(false);
}
+1 -1
View File
@@ -63,7 +63,7 @@ __EXPORT int param_set_external(param_t param, const void *val, bool mark_saved,
__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 */
__EXPORT int flash_param_save();
__EXPORT int flash_param_save(bool only_unsaved);
__EXPORT int flash_param_load();
__EXPORT int flash_param_import();