From c061f3f5860f2b337fd84587356d3baa86a306f2 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sun, 4 Nov 2018 20:51:48 +0100 Subject: [PATCH] ota.cpp small fixes --- src/ota.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ota.cpp b/src/ota.cpp index b02c15bd..12fcd6e7 100644 --- a/src/ota.cpp +++ b/src/ota.cpp @@ -84,16 +84,14 @@ void start_ota_update() { ESP_LOGI(TAG, "Connected to %s", WIFI_SSID); display(1, "OK", "WiFi connected"); // do a number of tries to update firmware limited by OTA_MAX_TRY - while (j--) { + while ((j--) && (!ret)) { ESP_LOGI(TAG, "Starting OTA update, attempt %u of %u. This will take some " "time to complete...", OTA_MAX_TRY - j, OTA_MAX_TRY); ret = do_ota_update(); - if (ret) - goto end; // update successful - } // update not successful - goto end; + } + goto end; } }