From 9ea0d8cd061ad0251e3549a9a080213156621062 Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Sun, 3 Sep 2023 02:05:46 +0530 Subject: [PATCH] Update Demo.ino --- examples/Demo/Demo.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Demo/Demo.ino b/examples/Demo/Demo.ino index 40cd8dc..a90a38f 100644 --- a/examples/Demo/Demo.ino +++ b/examples/Demo/Demo.ino @@ -52,7 +52,7 @@ void onOTAProgress(size_t current, size_t final) { // Log every 1 second if (millis() - ota_progress_millis > 1000) { ota_progress_millis = millis(); - Serial.printf("OTA update progress: %u%%\r", (current / (final / 100))); + Serial.printf("OTA update progress: %u%%\r", (final > 0 && current > 0) ? (current / (final / 100)) : 0); } }