]> granicus.if.org Git - esp-idf/commit
components/nvs: batch writes when possible
authorIvan Grokhotkov <ivan@espressif.com>
Thu, 22 Sep 2016 03:42:55 +0000 (11:42 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Thu, 22 Sep 2016 13:05:17 +0000 (21:05 +0800)
commit076141aab9eab081d6d06cde42695bb095a57607
treeb8d3c6bec4b3a80cea7f50f0ed8ff8a4d81d788a
parentba75f837b84a9d6aaf0a668cf01a42240be2c42b
components/nvs: batch writes when possible

Introduces new internal function, Page::alterEntryRangeState, which gathers changes to multiple elements of entry state table into a single write, provided that these changes fall into a single word. This allows changing state of up to 16 entries in a single write.
Also adds new function, writeEntryData, which writes the whole payload of SZ and BLOB type entries in one go, instead of splitting it into multiple 32-byte writes.
This reduces number of writes required for SZ and BLOB entries.
components/nvs_flash/src/nvs_page.cpp
components/nvs_flash/src/nvs_page.hpp
components/nvs_flash/src/nvs_storage.cpp
components/nvs_flash/test/test_nvs.cpp