Leading/trailing whitespace in prompts requires ugly workarounds in
genrest.py, as e.g. *prompt * is invalid RST. strip() all prompts in
Kconfiglib and get rid of the genrest.py workarounds. Add a warning too.
The Kconfiglib update has some unrelated cleanups and fixes (that won't
affect Zephyr).
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The settings_init() API was protected against multiple calls, but the
only function that calls it, settings_subsys_init(), was not. Add the
protection to the higher-level function as well.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
During the compression an empty settings entry was
copied to the scratch sector form the oldest sector in case
lack of newer entry version in fcb storage.
This doesn't make sense as empty entry and lack of entry has
similar meaning.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
If CONFIG_FLASH_PAGE_LAYOUT is not enabled, building the settings code
fails at the linking stage with the following error when FCB is the
backend.
libzephyr.a(settings_init.c.obj): In function `settings_init_fcb':
subsys/settings/src/settings_init.c:62: undefined reference to `flash_area_get_sectors'
collect2: error: ld returned 1 exit status
Also, the File System backend will currently only work with NFFS due
to fs_rename() missing from other File Systems (FAT in particular).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In f. settings_init_fcb the storage area was implemented badly:
- storage was always erased
- the only source of settings fcb instance was pointed twice.
This patch fix both issues.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
API settings_subsys_init call was changed so that it returns
error (so returns int instead of void).
Prototype of storage helper function export_func for
settings_handler::h_export was changed so that it returns error
(so returns int instead of void).
Fixed few other error handling issues by ignoring return
values.
Tests were aligned to above patches.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Adapt the MyNewt non-volatile configuration system to become a settings
system in Zephyr.
The original code was modifed in the following ways:
* Renamed from config to settings
* Use the zephyr FCB, FS API, and base64 subsystems
* lltoa like function was added to sources as it was required but not
included in Zephyr itself.
* The original code was modified to use Zephyr's slist.h as single
linked list implementation.
* Reworked code which was using strtok_r, added function
for decoding a string to a s64_t value.
* Thank to the above the settings subsys doesn't require newlibc anymore.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>