mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-05 22:01:56 +00:00
The current NVS code checks for an empty ATE using th _nvs_flash_cmp_const() function. This function loads the data and compare them to a value. This means that when executed multiple on the same area, the data get reloaded multiple time. This might have a noticeable performance impact with an SPI flash. Instead define a function _nvs_ate_cmp_const to compare an already read struct nvs_ate with a constant value. Then replace the calls to _nvs_flash_cmp_const() on struct nvs_ate by _nvs_flash_ate_rd() followed by _nvs_ate_cmp_const(). This also has the advantage of explicitly checking for errors instead of testing the error and the result of the comparison at the same time. Tested on a Nucleo L432KC board with the nvs sample. The maximum initialization time (ie just before running the first garbage collector) goes down to 6213 µs from 7350 µs. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> |
||
---|---|---|
.. | ||
app_memory | ||
bluetooth | ||
console | ||
cpp | ||
debug | ||
dfu | ||
disk | ||
fb | ||
fs | ||
logging | ||
mgmt | ||
net | ||
power | ||
random | ||
settings | ||
shell | ||
stats | ||
storage | ||
usb | ||
CMakeLists.txt | ||
Kconfig |