Bugfix in DDP handling

from upstream beta-3 branch, see 92390d1d59
This commit is contained in:
Frank
2023-06-07 21:56:55 +02:00
committed by GitHub
parent 6fd647ab15
commit 9ea7685419

View File

@@ -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++;
}
}