kopia lustrzana https://github.com/Aircoookie/WLED
Fixed WARLS performance issues
by choosing a more direct pixel drive technique and disabling effect processor and server while active (server did not work while active before already) Control via button and Alexa works while activepull/46/head
rodzic
849eefd64c
commit
7590e77153
|
@ -210,6 +210,8 @@ class WS2812FX : public NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp8266Uart800Kb
|
|||
}
|
||||
|
||||
void
|
||||
show(void),
|
||||
setPixelColor(uint16_t i, uint8_t r, uint8_t g, uint8_t b),
|
||||
init(void),
|
||||
service(void),
|
||||
start(void),
|
||||
|
@ -276,10 +278,8 @@ class WS2812FX : public NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp8266Uart800Kb
|
|||
|
||||
void
|
||||
begin(void),
|
||||
show(void),
|
||||
clear(void),
|
||||
setPixelColor(uint16_t i, uint32_t c),
|
||||
setPixelColor(uint16_t i, uint8_t r, uint8_t g, uint8_t b),
|
||||
setPixelColor(uint16_t i, uint8_t r, uint8_t g, uint8_t b, uint8_t w),
|
||||
setPixelColorRaw(uint16_t i, uint8_t r, uint8_t g, uint8_t b, uint8_t w),
|
||||
dofade(void),
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "WS2812FX.h"
|
||||
|
||||
//version in format yymmddb (b = daily build)
|
||||
#define VERSION 1712132
|
||||
#define VERSION 1712141
|
||||
|
||||
//If you have an RGBW strip, uncomment first line in WS2812FX.h!
|
||||
|
||||
|
@ -224,7 +224,6 @@ boolean auxActive, auxActiveBefore;
|
|||
boolean useGammaCorrectionBri = false;
|
||||
boolean useGammaCorrectionRGB = true;
|
||||
int arlsOffset = -22; //10: -22 assuming arls52
|
||||
boolean realtimeEnabled = true;
|
||||
|
||||
//alexa
|
||||
Switch *alexa = NULL;
|
||||
|
@ -286,21 +285,25 @@ void setup() {
|
|||
}
|
||||
|
||||
void loop() {
|
||||
server.handleClient();
|
||||
handleNotifications();
|
||||
handleTransitions();
|
||||
handleNightlight();
|
||||
yield();
|
||||
handleButton();
|
||||
handleNetworkTime();
|
||||
#ifdef USEOVERLAYS
|
||||
handleOverlays();
|
||||
#endif
|
||||
#ifdef CRONIXIE
|
||||
handleCronixie();
|
||||
#endif
|
||||
handleAlexa();
|
||||
strip.service();
|
||||
if (!arlsTimeout)
|
||||
{
|
||||
handleNetworkTime();
|
||||
#ifdef USEOVERLAYS
|
||||
handleOverlays();
|
||||
#endif
|
||||
strip.service();
|
||||
server.handleClient();
|
||||
}
|
||||
|
||||
//DEBUG
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -78,7 +78,7 @@ void handleNotifications()
|
|||
bri = udpIn[2];
|
||||
colorUpdated(3);
|
||||
}
|
||||
} else if (udpIn[0] == 1 && realtimeEnabled) //warls
|
||||
} else if (udpIn[0] == 1) //warls
|
||||
{
|
||||
if (packetSize > 1) {
|
||||
if (udpIn[1] == 0)
|
||||
|
@ -97,11 +97,12 @@ void handleNotifications()
|
|||
if (udpIn[i] + arlsOffset < ledcount && udpIn[i] + arlsOffset >= 0)
|
||||
if (useGammaCorrectionRGB)
|
||||
{
|
||||
strip.setIndividual(udpIn[i] + arlsOffset, ((uint32_t)gamma8[udpIn[i+1]] << 16) | ((uint32_t)gamma8[udpIn[i+2]] << 8) | gamma8[udpIn[i+3]]);
|
||||
strip.setPixelColor(udpIn[i] + arlsOffset, gamma8[udpIn[i+1]], gamma8[udpIn[i+2]], gamma8[udpIn[i+3]]);
|
||||
} else {
|
||||
strip.setIndividual(udpIn[i], ((uint32_t)udpIn[i+1] << 16) | ((uint32_t)udpIn[i+2] << 8) | udpIn[i+3]);
|
||||
strip.setPixelColor(udpIn[i] + arlsOffset, udpIn[i+1], udpIn[i+2], udpIn[i+3]);
|
||||
}
|
||||
}
|
||||
strip.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue