settings: fix custom backend example

Fix example of custom backend implementation

Fixes: #20163.

Signed-off-by: François Delawarde <fnde@oticon.com>
This commit is contained in:
François Delawarde 2019-10-30 08:09:48 +01:00 committed by Ioannis Glaropoulos
parent b718165c32
commit 468a834af0
1 changed files with 9 additions and 2 deletions

View File

@ -252,15 +252,22 @@ handler (:option:`CONFIG_SETTINGS_CUSTOM`).
//...
}
/* custom backend interface */
static struct settings_store_itf settings_custom_itf = {
.csi_load = settings_custom_load,
.csi_save = settings_custom_save,
};
/* custom backend node */
static struct settings_store settings_custom_store = {
.cs_itf = &settings_custom_itf
}
int settings_backend_init(void)
{
settings_dst_register(&settings_custom_itf);
settings_src_register(&settings_custom_itf);
/* register custom backend */
settings_dst_register(&settings_custom_store);
settings_src_register(&settings_custom_store);
return 0;
}