The settings subsystem has been adding nffs's include dir to the
global set of paths. Presumably because app's will need acces. But
this is no longer necessary as we default to linking 'app' with FS,
which again has the NFFS include paths.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Bool symbols implicitly default to 'n'.
A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.
Remove some 'default ""' properties on string symbols too.
Also make definitions more consistent by converting some
config FOO
<type>
prompt "foo"
definitions to a shorter form:
config FOO
<type> "foo"
This shorthand works for int/hex/string symbols too, not just for bool
symbols.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Fix file exist error within settings_subsys_init in order to correctly
reload existing settings when CONFIG_SETTINGS_FS is enabled.
Signed-off-by: Daniele Biagetti <daniele.biagetti@cblelectronics.com>
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>