examples: minor tweaks to comments
This commit is contained in:
parent
3aca537157
commit
9aa9086c8b
5 changed files with 10 additions and 20 deletions
|
@ -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).
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue