examples: check return value of nvs_flash_init

nvs_flash_init may return an error code in some cases, and applications
should check this error code (or at least assert on it being ESP_OK, to
make potential issues more immediately obvious).

This change modifies all the examples which use NVS to check the error
code. Most examples get a simple ESP_ERROR_CHECK assert, while NVS
examples, OTA example, and NVS unit tests get a more verbose check which
may be used in real applications.
This commit is contained in:
Ivan Grokhotkov
2017-03-14 21:39:44 +08:00
parent f59f13efd5
commit 4813ab2d28
14 changed files with 68 additions and 24 deletions

View File

@@ -325,7 +325,7 @@ static void https_get_task(void *pvParameters)
void app_main()
{
nvs_flash_init();
ESP_ERROR_CHECK( nvs_flash_init() );
initialise_wifi();
xTaskCreate(&https_get_task, "https_get_task", 8192, NULL, 5, NULL);
}