feat(nvs_flash): Added support for storing flash and double types

- added backward compatibility test for unknown NVS entry types
 - axtended documentation with the support of double and float
This commit is contained in:
radek.tandler
2026-03-31 19:02:43 +02:00
parent e07b6dec77
commit a5443bbb94
12 changed files with 1146 additions and 21 deletions
@@ -35,6 +35,7 @@ NVS 的操作对象为键值对,其中键是 ASCII 字符串,当前支持的
- 整数型:``uint8_t``、``int8_t``、``uint16_t``、``int16_t``、``uint32_t``、``int32_t``、``uint64_t`` 和 ``int64_t``;
- 以 0 结尾的字符串;
- 可变长度的二进制数据 (BLOB)
- 浮点类型:``float`` 和 ``double``
.. note::
@@ -48,7 +49,9 @@ NVS 的操作对象为键值对,其中键是 ASCII 字符串,当前支持的
在设置新的键值对或更新现有键值对之前,NVS 页中必须有可用的空闲条目。对于整数类型,至少需要有一个空闲条目。对于字符串值,至少需要一个能够将整个字符串连续存储在空闲条目中的页面。对于 blob 值,空闲条目中需要有足够空间容纳新数据的大小。
其他数据类型,例如 ``float`` 和 ``double``,可能会在以后添加。
.. note::
无论特定 SoC 上是否存在 FPU,均支持浮点类型 ``float`` 和 ``double``。
键必须唯一。为现有的键写入新值时,会将旧的值及数据类型更新为写入操作指定的值和数据类型。