Added support for E1.31 with more than 170 LEDs
This commit is contained in:
parent
042605701e
commit
48c165b0b4
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
|
|
||||||
//version code in format yymmddb (b = daily build)
|
//version code in format yymmddb (b = daily build)
|
||||||
#define VERSION 1810271
|
#define VERSION 1810311
|
||||||
char versionString[] = "0.8.1";
|
char versionString[] = "0.8.1";
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,6 +76,27 @@ void initE131(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handleE131(){
|
||||||
|
//E1.31 protocol support
|
||||||
|
if(e131Enabled) {
|
||||||
|
uint16_t len = e131->parsePacket();
|
||||||
|
if (!len || e131->universe < e131Universe || e131->universe > e131Universe +4) return;
|
||||||
|
len /= 3; //one LED is 3 DMX channels
|
||||||
|
|
||||||
|
uint16_t multipacketOffset = (e131->universe - e131Universe)*170; //if more than 170 LEDs (510 channels), client will send in next higher universe
|
||||||
|
if (ledCount <= multipacketOffset) return;
|
||||||
|
|
||||||
|
arlsLock(realtimeTimeoutMs);
|
||||||
|
if (len + multipacketOffset > ledCount) len = ledCount - multipacketOffset;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < len; i++) {
|
||||||
|
int j = i * 3;
|
||||||
|
setRealtimePixel(i + multipacketOffset, e131->data[j], e131->data[j+1], e131->data[j+2], 0);
|
||||||
|
}
|
||||||
|
strip.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void handleNotifications()
|
void handleNotifications()
|
||||||
{
|
{
|
||||||
//send second notification if enabled
|
//send second notification if enabled
|
||||||
@ -83,20 +104,7 @@ void handleNotifications()
|
|||||||
notify(notificationSentCallMode,true);
|
notify(notificationSentCallMode,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//E1.31 protocol support
|
handleE131();
|
||||||
if(e131Enabled) {
|
|
||||||
uint16_t len = e131->parsePacket();
|
|
||||||
if (len && e131->universe == e131Universe) {
|
|
||||||
arlsLock(realtimeTimeoutMs);
|
|
||||||
if (len > ledCount) len = ledCount;
|
|
||||||
for (uint16_t i = 0; i < len; i++) {
|
|
||||||
int j = i * 3;
|
|
||||||
|
|
||||||
setRealtimePixel(i, e131->data[j], e131->data[j+1], e131->data[j+2], 0);
|
|
||||||
}
|
|
||||||
strip.show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//unlock strip when realtime UDP times out
|
//unlock strip when realtime UDP times out
|
||||||
if (realtimeActive && millis() > realtimeTimeout)
|
if (realtimeActive && millis() > realtimeTimeout)
|
||||||
@ -227,9 +235,9 @@ void handleNotifications()
|
|||||||
uint16_t id = ((udpIn[3] << 0) & 0xFF) + ((udpIn[2] << 8) & 0xFF00);
|
uint16_t id = ((udpIn[3] << 0) & 0xFF) + ((udpIn[2] << 8) & 0xFF00);
|
||||||
for (uint16_t i = 4; i < packetSize -2; i += 3)
|
for (uint16_t i = 4; i < packetSize -2; i += 3)
|
||||||
{
|
{
|
||||||
|
if (id >= ledCount) break;
|
||||||
setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3]);
|
setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3]);
|
||||||
|
id++;
|
||||||
id++; if (id >= ledCount) break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
strip.show();
|
strip.show();
|
||||||
|
Loading…
Reference in New Issue
Block a user