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 active
pull/46/head
cschwinne 2017-12-14 11:28:15 +01:00
rodzic 849eefd64c
commit 7590e77153
3 zmienionych plików z 16 dodań i 12 usunięć

Wyświetl plik

@ -210,6 +210,8 @@ class WS2812FX : public NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp8266Uart800Kb
} }
void void
show(void),
setPixelColor(uint16_t i, uint8_t r, uint8_t g, uint8_t b),
init(void), init(void),
service(void), service(void),
start(void), start(void),
@ -276,10 +278,8 @@ class WS2812FX : public NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp8266Uart800Kb
void void
begin(void), begin(void),
show(void),
clear(void), clear(void),
setPixelColor(uint16_t i, uint32_t c), 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), 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), setPixelColorRaw(uint16_t i, uint8_t r, uint8_t g, uint8_t b, uint8_t w),
dofade(void), dofade(void),

Wyświetl plik

@ -25,7 +25,7 @@
#include "WS2812FX.h" #include "WS2812FX.h"
//version in format yymmddb (b = daily build) //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! //If you have an RGBW strip, uncomment first line in WS2812FX.h!
@ -224,7 +224,6 @@ boolean auxActive, auxActiveBefore;
boolean useGammaCorrectionBri = false; boolean useGammaCorrectionBri = false;
boolean useGammaCorrectionRGB = true; boolean useGammaCorrectionRGB = true;
int arlsOffset = -22; //10: -22 assuming arls52 int arlsOffset = -22; //10: -22 assuming arls52
boolean realtimeEnabled = true;
//alexa //alexa
Switch *alexa = NULL; Switch *alexa = NULL;
@ -286,21 +285,25 @@ void setup() {
} }
void loop() { void loop() {
server.handleClient();
handleNotifications(); handleNotifications();
handleTransitions(); handleTransitions();
handleNightlight(); handleNightlight();
yield(); yield();
handleButton(); handleButton();
handleNetworkTime(); handleNetworkTime();
#ifdef USEOVERLAYS
handleOverlays();
#endif
#ifdef CRONIXIE #ifdef CRONIXIE
handleCronixie(); handleCronixie();
#endif #endif
handleAlexa(); handleAlexa();
strip.service(); if (!arlsTimeout)
{
handleNetworkTime();
#ifdef USEOVERLAYS
handleOverlays();
#endif
strip.service();
server.handleClient();
}
//DEBUG //DEBUG
#ifdef DEBUG #ifdef DEBUG

Wyświetl plik

@ -78,7 +78,7 @@ void handleNotifications()
bri = udpIn[2]; bri = udpIn[2];
colorUpdated(3); colorUpdated(3);
} }
} else if (udpIn[0] == 1 && realtimeEnabled) //warls } else if (udpIn[0] == 1) //warls
{ {
if (packetSize > 1) { if (packetSize > 1) {
if (udpIn[1] == 0) if (udpIn[1] == 0)
@ -97,11 +97,12 @@ void handleNotifications()
if (udpIn[i] + arlsOffset < ledcount && udpIn[i] + arlsOffset >= 0) if (udpIn[i] + arlsOffset < ledcount && udpIn[i] + arlsOffset >= 0)
if (useGammaCorrectionRGB) 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 { } 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();
} }
} }
} }