mirror of
https://github.com/wled/WLED.git
synced 2025-07-21 09:46:32 +00:00
Unsigned fix
This commit is contained in:
parent
d3c31c52a2
commit
092a5a1ca3
@ -551,13 +551,13 @@ void BusPwm::show() {
|
|||||||
if (_reversed) duty = maxBri - duty;
|
if (_reversed) duty = maxBri - duty;
|
||||||
analogWrite(_pins[i], duty);
|
analogWrite(_pins[i], duty);
|
||||||
#else
|
#else
|
||||||
unsigned deadTime = 0;
|
int deadTime = 0;
|
||||||
if (_type == TYPE_ANALOG_2CH && Bus::getCCTBlend() == 0) {
|
if (_type == TYPE_ANALOG_2CH && Bus::getCCTBlend() == 0) {
|
||||||
// add dead time between signals (when using dithering, two full 8bit pulses are required)
|
// add dead time between signals (when using dithering, two full 8bit pulses are required)
|
||||||
deadTime = (1+dithering) << bitShift;
|
deadTime = (1+dithering) << bitShift;
|
||||||
// we only need to take care of shortening the signal at (almost) full brightness otherwise pulses may overlap
|
// 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 (_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;
|
if (_reversed) duty = maxBri - duty;
|
||||||
unsigned channel = _ledcStart + i;
|
unsigned channel = _ledcStart + i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user