From bc9c7c22a8ebcd5b28d174a4b464c0221472463d Mon Sep 17 00:00:00 2001 From: CommanderRedYT Date: Wed, 8 Dec 2021 02:24:24 +0100 Subject: [PATCH] Fixed ota animation --- main/ledstrip.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main/ledstrip.cpp b/main/ledstrip.cpp index b35229a..f8763dd 100644 --- a/main/ledstrip.cpp +++ b/main/ledstrip.cpp @@ -236,7 +236,6 @@ void showOtaAnimation() { std::fill(std::begin(leds), std::end(leds), CRGB{0,0,0}); const auto leds_count = leds.size(); - const int one_percent = leds_count / 100; float percentage = 0; const auto progress = asyncOta->progress(); @@ -245,7 +244,7 @@ void showOtaAnimation() percentage = (float(progress) / *totalSize * 100); if (settings.ledstrip.otaMode == OtaAnimationModes::GreenProgressBar) { - int numLeds = one_percent * percentage; + int numLeds = (leds_count * percentage) / 100; if (numLeds >= leds_count) { numLeds = leds_count - 1;