]> granicus.if.org Git - esp-idf/commitdiff
examples: minor tweaks to comments
authorIvan Grokhotkov <ivan@espressif.com>
Fri, 11 Nov 2016 04:16:54 +0000 (12:16 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Fri, 11 Nov 2016 04:16:54 +0000 (12:16 +0800)
examples/07_nvs_rw_value/README.md
examples/07_nvs_rw_value/main/component.mk
examples/07_nvs_rw_value/main/nvs_rw_value.c
examples/08_nvs_rw_blob/main/component.mk
examples/08_nvs_rw_blob/main/nvs_rw_blob.c

index 83dc29fd18d3fcfdfb30abb8445524ca81e733a4..09cd364e8d132c5c025632d3426df1ce7fa77764 100644 (file)
@@ -4,9 +4,9 @@ Demonstrates how to read and write a single integer value using NVS.
 
 The value holds the number of ESP32 module restarts. Since it is written to NVS, the value is preserved between restarts.
 
-Example also shows how to check if read / write operation was successful, or certain value is not initialized in NVR. Diagnostic is provided in plain text to help track program flow and capture any issues on the way.
+Example also shows how to check if read / write operation was successful, or certain value is not initialized in NVS. Diagnostic is provided in plain text to help track program flow and capture any issues on the way.
 
-Check another example *08_nvs_rw_blob*, that shows how to read and write a blob (binary large object).
+Check another example *08_nvs_rw_blob*, that shows how to read and write variable length binary data (blob).
 
 Detailed functional description of NVS and API is provided in [documentation](http://esp-idf.readthedocs.io/en/latest/api/nvs_flash.html).
 
index 24356f23ed2e292e153170d8edda3dd5dce430aa..d33485c26c64983e12058a18c129b0ef3f953d05 100644 (file)
@@ -1,10 +1,2 @@
-#
-# Main Makefile. This is basically the same as a component makefile.
-#
-# This Makefile should, at the very least, just include $(SDK_PATH)/make/component_common.mk. By default, 
-# this will take the sources in the src/ directory, compile them and link them into 
-# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
-# please read the ESP-IDF documents if you need to do this.
-#
 
 include $(IDF_PATH)/make/component_common.mk
index df53d33b4a575dc93e4dfe6201976c92aad5d10f..978c48edb8473641bbf4ae1f804baa30829acd83 100644 (file)
@@ -55,7 +55,10 @@ void app_main()
         err = nvs_set_i32(my_handle, "restart_conter", restart_counter);
         printf((err != ESP_OK) ? "Failed!\n" : "Done\n");
 
-        // Commit
+        // Commit written value.
+        // After setting any values, nvs_commit() must be called to ensure changes are written
+        // to flash storage. Implementations may write to storage at other times,
+        // but this is not guaranteed.
         printf("Committing updates in NVS ... ");
         err = nvs_commit(my_handle);
         printf((err != ESP_OK) ? "Failed!\n" : "Done\n");
index 24356f23ed2e292e153170d8edda3dd5dce430aa..d33485c26c64983e12058a18c129b0ef3f953d05 100644 (file)
@@ -1,10 +1,2 @@
-#
-# Main Makefile. This is basically the same as a component makefile.
-#
-# This Makefile should, at the very least, just include $(SDK_PATH)/make/component_common.mk. By default, 
-# this will take the sources in the src/ directory, compile them and link them into 
-# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
-# please read the ESP-IDF documents if you need to do this.
-#
 
 include $(IDF_PATH)/make/component_common.mk
index 38066bf62f42f9b681cd3ec6a546b67249f52d72..3fbdfcacd65c4dd227b31a6e3d7b3a69b7f70fd5 100644 (file)
@@ -44,7 +44,10 @@ esp_err_t save_restart_counter(void)
     err = nvs_set_i32(my_handle, "restart_conter", restart_counter);
     if (err != ESP_OK) return err;
 
-    // Commit
+    // Commit written value.
+    // After setting any values, nvs_commit() must be called to ensure changes are written
+    // to flash storage. Implementations may write to storage at other times,
+    // but this is not guaranteed.
     err = nvs_commit(my_handle);
     if (err != ESP_OK) return err;