From a740d71c820a9ae9b842e7e908525b77b58f51e4 Mon Sep 17 00:00:00 2001 From: mxklb Date: Fri, 17 Nov 2023 14:18:30 +0100 Subject: [PATCH] Added parentheses --- wled00/e131.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wled00/e131.cpp b/wled00/e131.cpp index 40cd49d2..15a0e71c 100644 --- a/wled00/e131.cpp +++ b/wled00/e131.cpp @@ -149,11 +149,11 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){ realtimeLock(realtimeTimeoutMs, mde); if (realtimeOverride && !(realtimeMode && useMainSegmentOnly)) return; - dmxChannelCount = useMainSegmentOnly ? strip.getMainSegment().hasWhite() : strip.hasWhiteChannel() ? 4 : 3; + dmxChannelCount = (useMainSegmentOnly ? strip.getMainSegment().hasWhite() : strip.hasWhiteChannel()) ? 4 : 3; if (availDMXLen < dmxChannelCount) return; wChannel = dmxChannelCount == 4 ? e131_data[dataOffset+3] : 0; - for (uint16_t i = 0; i < totalLen; i++) + for (uint16_t i = 0; i < useMainSegmentOnly ? strip.getMainSegment().length() : totalLen; i++) setRealtimePixel(i, e131_data[dataOffset+0], e131_data[dataOffset+1], e131_data[dataOffset+2], wChannel); break; @@ -163,7 +163,7 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){ realtimeLock(realtimeTimeoutMs, mde); if (realtimeOverride && !(realtimeMode && useMainSegmentOnly)) return; - dmxChannelCount = useMainSegmentOnly ? strip.getMainSegment().hasWhite() : strip.hasWhiteChannel() ? 5 : 4; + dmxChannelCount = (useMainSegmentOnly ? strip.getMainSegment().hasWhite() : strip.hasWhiteChannel()) ? 5 : 4; if (availDMXLen < dmxChannelCount) return; if (bri != e131_data[dataOffset+0]) {