diff --git a/doc/reference/runtime_conf/settings/settings.rst b/doc/reference/runtime_conf/settings/settings.rst index 30a8a20b784..387fecfda1e 100644 --- a/doc/reference/runtime_conf/settings/settings.rst +++ b/doc/reference/runtime_conf/settings/settings.rst @@ -141,12 +141,6 @@ export functionality, for example, writing to the shell console). static int8 foo_val = DEFAULT_FOO_VAL_VALUE; - struct settings_handler my_conf = { - .name = "foo", - .h_set = foo_settings_set, - .h_export = foo_settings_export - }; - static int foo_settings_set(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg) { @@ -179,6 +173,12 @@ export functionality, for example, writing to the shell console). return storage_func("foo/bar", &foo_val, sizeof(foo_val)); } + struct settings_handler my_conf = { + .name = "foo", + .h_set = foo_settings_set, + .h_export = foo_settings_export + }; + Example: Persist Runtime State ****************************** @@ -197,11 +197,6 @@ up from where it was before restart. static int8 foo_val = DEFAULT_FOO_VAL_VALUE; - struct settings_handler my_conf = { - .name = "foo", - .h_set = foo_settings_set - }; - static int foo_settings_set(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg) { @@ -236,6 +231,11 @@ up from where it was before restart. sys_reboot(SYS_REBOOT_COLD); } + struct settings_handler my_conf = { + .name = "foo", + .h_set = foo_settings_set + }; + Example: Custom Backend Implementation **************************************