Commit graph

6 commits

Author SHA1 Message Date
Ivan Grokhotkov a25a4a0a7c nvs: check value size before writing, document limitations
Writing values longer than half of the page size (with header taken into
account) causes fragmentation issues. Previously it was suggested on the
forum that using long values may cause issues, but this wasn’t checked
in the library itself, and wasn’t documented. This change adds necessary
checks and introduces the new error code.

Documentation is also fixed to reflect the fact that the maximum length
of the key is 15 characters, not 16.
2017-05-31 12:59:24 +08:00
Ivan Grokhotkov 5a23ec4dc4 nvs: check that storage has at least one free page
This change adds a check for the free page count to nvs_flash_init.
Under normal operation, NVS keeps at least one free page available,
except for transient states such as freeing up new page. Due to external
factors (such as NVS partition size reduction) this free page could be
lost, making NVS operation impossible. Previously this would cause an
error when performing any nvs_set operation or opening a new namespace.
With this change, an error is returned from nvs_flash_init to indicate
that NVS partition is in such a state.
2017-03-14 22:03:39 +08:00
Krzysztof fa002b4909 Fixed headers to match python doc standard 2016-11-01 01:20:04 +08:00
Ivan Grokhotkov 12a0786e2a components/nvs: maintain item hash list at page level 2016-09-21 18:02:52 +08:00
Ivan Grokhotkov b783e2ffab components/nvs: fix typos in readme 2016-08-23 12:08:00 +08:00
Ivan Grokhotkov bd6ea4393c Initial public version 2016-08-17 23:08:22 +08:00