From 092a5a1ca34c2c17c353c6c0c87550cf831a9e80 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Wed, 4 Sep 2024 20:54:44 +0200 Subject: [PATCH] Unsigned fix --- wled00/bus_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index e18d1023c0..ef7df007df 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -551,13 +551,13 @@ void BusPwm::show() { if (_reversed) duty = maxBri - duty; analogWrite(_pins[i], duty); #else - unsigned deadTime = 0; + int deadTime = 0; if (_type == TYPE_ANALOG_2CH && Bus::getCCTBlend() == 0) { // add dead time between signals (when using dithering, two full 8bit pulses are required) deadTime = (1+dithering) << bitShift; // we only need to take care of shortening the signal at (almost) full brightness otherwise pulses may overlap if (_bri >= 254 && duty >= maxBri / 2 && duty < maxBri) duty -= deadTime << 1; // shorten duty of larger signal except if full on - if(_reversed) deadTime = -deadTime; // need to invert dead time to make phaseshift go the opposite way so low signals dont overlap + if (_reversed) deadTime = -deadTime; // need to invert dead time to make phaseshift go the opposite way so low signals dont overlap } if (_reversed) duty = maxBri - duty; unsigned channel = _ledcStart + i;