settings: add note to documentation

Add information about commit priority to settings documentation.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
This commit is contained in:
Laczen JMS 2024-10-22 09:32:38 +02:00 committed by David Leach
commit 237a18928b

View file

@ -30,7 +30,9 @@ Handlers
********
Settings handlers for subtree implement a set of handler functions.
These are registered using a call to :c:func:`settings_register()`.
These are registered using a call to :c:func:`settings_register()` for
dynamic handlers or defined using a call to :c:macro:`SETTINGS_STATIC_HANDLER_DEFINE()`
for static handlers.
**h_get**
This gets called when asking for a settings element value by its name using
@ -52,6 +54,16 @@ These are registered using a call to :c:func:`settings_register()`.
when :c:func:`settings_save()` tries to save the settings or transfer to any
user-implemented back-end.
Settings handlers also have a commit priority ``cprio`` that allows to prioritize
the ``h_commit`` calls. This can be advantageous when e.g. a subsystem initializes
a service that other ``h_commit`` calls depend on.
Settings handlers ``h_commit`` routines are by default initialized with ``cprio = 0``,
initializing a settings handler with a different priority is done using a call to
:c:func:`settings_register_with_cprio()` for dynamic handlers or using a call to
:c:macro:`SETTINGS_STATIC_HANDLER_DEFINE_WITH_CPRIO()` for static handlers. The
specified ``cprio`` value is an integer where lower values mean higher priority.
Backends
********