From e5eb6dcc93042a055bc86548d9d07aae3d7fea3d Mon Sep 17 00:00:00 2001 From: Zhang Shuxian Date: Mon, 3 Nov 2025 10:49:52 +0800 Subject: [PATCH] docs: Update CN translation for NVS statistics example --- docs/en/api-reference/storage/nvs_flash.rst | 2 +- docs/zh_CN/api-reference/storage/index.rst | 4 ++++ docs/zh_CN/api-reference/storage/nvs_flash.rst | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/en/api-reference/storage/nvs_flash.rst b/docs/en/api-reference/storage/nvs_flash.rst index aa09bfeadb0..ac26eefcb2f 100644 --- a/docs/en/api-reference/storage/nvs_flash.rst +++ b/docs/en/api-reference/storage/nvs_flash.rst @@ -191,7 +191,7 @@ You can find code examples in the :example:`storage` directory of ESP-IDF exampl Default NVS partition is erased for a clean run of this example. Then mock data consisting of different NVS integer data types are written. - After that, iteration is performed over the individual data types, as well as the generic ``NVS_TYPE_ANY``, and relevant entry info gained from iteration is logged. + After that, the example iterates over each individual data type as well as the generic ``NVS_TYPE_ANY`` type, and logs the information obtained from each iteration. Internals --------- diff --git a/docs/zh_CN/api-reference/storage/index.rst b/docs/zh_CN/api-reference/storage/index.rst index 4c0d162a1bc..90f63651d04 100644 --- a/docs/zh_CN/api-reference/storage/index.rst +++ b/docs/zh_CN/api-reference/storage/index.rst @@ -53,6 +53,10 @@ - 演示了如何在 NVS flash 中使用 C 语言 API 读写整数数据类型。 * - :example:`nvs_rw_value ` - 演示了如何在 NVS flash 中使用 C++ 语言 API 读写整数数据类型。 + * - :example:`nvs_statistics ` + - 演示了如何使用 C 风格 API 获取 NVS 使用情况统计信息,包括指定 NVS 分区中的空闲、已用、可用、总条目数、以及命名空间数量。 + * - :example:`nvs_iteration ` + - 演示了如何使用 C 风格 API 遍历特定(或任意)NVS 数据类型的条目,以及如何获取这些条目的相关信息。 * - :example:`nvs_bootloader ` - 演示了如何使用引导加载程序代码中可用的 API 来读取 NVS 数据。 * - :example:`nvsgen ` diff --git a/docs/zh_CN/api-reference/storage/nvs_flash.rst b/docs/zh_CN/api-reference/storage/nvs_flash.rst index 59d131cf51f..c58281e40bc 100644 --- a/docs/zh_CN/api-reference/storage/nvs_flash.rst +++ b/docs/zh_CN/api-reference/storage/nvs_flash.rst @@ -177,6 +177,22 @@ ESP-IDF :example:`storage` 目录下提供了数个代码示例: 这个例子与 :example:`storage/nvs_rw_value` 完全一样,只是使用了 C++ 的 NVS 句柄类。 +:example:`storage/nvs_statistics` + + 该示例演示了如何获取并解读 NVS 使用情况统计信息:包括指定 NVS 分区中的空闲、已用、可用、总条目数、以及命名空间数量。 + + 默认的 NVS 分区会在运行本示例前被擦除,以确保干净的运行环境。随后,会写入模拟的字符串类型数据。 + + 在写入数据前后分别获取使用情况统计信息,并将两者的差异与新占用条目的预期值进行比较。 + +:example:`storage/nvs_iteration` + + 该示例演示了如何遍历特定(或任意)NVS 数据类型的条目,以及如何获取这些条目的相关信息。 + + 默认的 NVS 分区会在运行本示例前被擦除,以确保干净的运行环境。随后,会写入包含不同 NVS 整型数据类型的模拟数据。 + + 之后,本示例会遍历各个数据类型以及通用的 ``NVS_TYPE_ANY`` 类型,并记录在每次遍历过程中获取到的信息。 + 内部实现 ---------