From 5924dafd94928c4144581ac831c07c02786ba702 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 14 Mar 2017 21:39:44 +0800 Subject: [PATCH] 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. * Original commit: espressif/esp-idf@4813ab2d28081ca1f7682343e721485b1a53cd19 --- examples/protocols/mdns/main/mdns_example_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/protocols/mdns/main/mdns_example_main.c b/examples/protocols/mdns/main/mdns_example_main.c index d19fd1ae6..50b74e08c 100644 --- a/examples/protocols/mdns/main/mdns_example_main.c +++ b/examples/protocols/mdns/main/mdns_example_main.c @@ -178,7 +178,7 @@ static void mdns_task(void *pvParameters) void app_main() { - nvs_flash_init(); + ESP_ERROR_CHECK( nvs_flash_init() ); initialise_wifi(); xTaskCreate(&mdns_task, "mdns_task", 2048, NULL, 5, NULL); }