From a2e9e77ca71d99366c7c3dd574cd1f7e9ef034f9 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:07:17 +0100 Subject: [PATCH] setTargetFps with rounding --- wled00/FX_fcn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 592ebb5b..5df577a2 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -2118,7 +2118,7 @@ uint16_t WS2812FX::getFps() const { void WS2812FX::setTargetFps(uint8_t fps) { if (fps <= 251) _targetFps = fps; // WLEDMM allow higher framerates - if (fps > 0) _frametime = 1000 / _targetFps; + if (fps > 0) _frametime = ((2000 / _targetFps) +1) /2; // with rounding else _frametime = 2; // AC WLED compatibility if (fps >= FPS_UNLIMITED) _frametime = 2; // WLEDMM unlimited mode }