From 9ea76854192c1dbc5afa9f1dd071d1359039252f Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Wed, 7 Jun 2023 21:56:55 +0200 Subject: [PATCH] Bugfix in DDP handling from upstream beta-3 branch, see https://github.com/Aircoookie/WLED/commit/92390d1d5909f4b070957a0e5e92f8bb5230a544 --- wled00/e131.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wled00/e131.cpp b/wled00/e131.cpp index f3087b64..18c1e3cf 100644 --- a/wled00/e131.cpp +++ b/wled00/e131.cpp @@ -25,8 +25,7 @@ void handleDDPPacket(e131_packet_t* p) { } } - // WLEDMM this line seems very wrong - anything & 0b00111000 cannot have the last 3 bits set .... also there is a compiler warning "suggest parentheses around comparison in operand of '&'" - uint8_t ddpChannelsPerLed = (p->dataType & 0b00111000 == 0b011) ? 4 : 3; // data type 0x1B (formerly 0x1A) is RGBW (type 3, 8 bit/channel) + uint8_t ddpChannelsPerLed = ((p->dataType & 0b00111000)>>3 == 0b011) ? 4 : 3; // data type 0x1B (formerly 0x1A) is RGBW (type 3, 8 bit/channel) uint32_t start = htonl(p->channelOffset) / ddpChannelsPerLed; start += DMXAddress / ddpChannelsPerLed; @@ -533,4 +532,4 @@ void sendArtnetPollReply(ArtPollReply *reply, IPAddress ipAddress, uint16_t port notifierUdp.endPacket(); reply->reply_bind_index++; -} \ No newline at end of file +}