From 72b79608bf923285106869e18be8012d123a7222 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Thu, 6 Jul 2023 19:07:09 +0200 Subject: [PATCH] 2DPlasmaball - optimize out float --- wled00/FX.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 278f2913b7..bafd45ba5b 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -5285,7 +5285,7 @@ uint16_t mode_2DPlasmaball(void) { // By: Stepko https://edito SEGMENT.fadeToBlackBy(SEGMENT.custom1>>2); - float t = millis() / (33 - SEGMENT.speed/8); + uint_fast32_t t = (millis() * 8) / (256 - SEGMENT.speed); // optimized to avoid float for (int i = 0; i < cols; i++) { uint16_t thisVal = inoise8(i * 30, t, t); uint16_t thisMax = map(thisVal, 0, 255, 0, cols-1);