diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 95b80eeb..22625c29 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -215,10 +215,17 @@ void WS2812FX::show(void) { //each LED can draw up 195075 "power units" (approx. 53mA) //one PU is the power it takes to have 1 channel 1 step brighter per brightness step //so A=2,R=255,G=0,B=0 would use 510 PU per LED (1mA is about 3700 PU) - - if (ablMilliampsMax > 149 && milliampsPerLed > 0) //0 mA per LED and too low numbers turn off calculation + bool useWackyWS2815PowerModel = false; + byte actualMilliampsPerLed = milliampsPerLed; + + if(milliampsPerLed == 255) { + useWackyWS2815PowerModel = true; + actualMilliampsPerLed = 12; // from testing an actual strip + } + + if (ablMilliampsMax > 149 && actualMilliampsPerLed > 0) //0 mA per LED and too low numbers turn off calculation { - uint32_t puPerMilliamp = 195075 / milliampsPerLed; + uint32_t puPerMilliamp = 195075 / actualMilliampsPerLed; uint32_t powerBudget = (ablMilliampsMax - MA_FOR_ESP) * puPerMilliamp; //100mA for ESP power if (powerBudget > puPerMilliamp * _length) //each LED uses about 1mA in standby, exclude that from power budget { @@ -233,9 +240,19 @@ void WS2812FX::show(void) { for (uint16_t i = 0; i < _length; i++) //sum up the usage of each LED { RgbwColor c = bus->GetPixelColorRgbw(i); - powerSum += (c.R + c.G + c.B + c.W); + + if(useWackyWS2815PowerModel) + { + // ignore white component on WS2815 power calculation + powerSum += (max(max(c.R,c.G),c.B)) * 3; + } + else + { + powerSum += (c.R + c.G + c.B + c.W); + } } + if (_rgbwMode) //RGBW led total output with white LEDs enabled is still 50mA, so each channel uses less { powerSum *= 3; diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index 450512b0..190d6b53 100644 Binary files a/wled00/data/settings_leds.htm and b/wled00/data/settings_leds.htm differ diff --git a/wled00/html_settings.h b/wled00/html_settings.h index cbda5877..e99c03c5 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -75,7 +75,8 @@ const char PAGE_settings_leds[] PROGMEM = R"=====(