Skip to content

Commit 081a524

Browse files
committed
Don't recalculate length in every iteration
1 parent 71418f6 commit 081a524

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

wled00/e131.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){
9797
uint8_t artnetOffset = (protocol == P_ARTNET) ? -1 : 0;
9898

9999
#ifdef WLED_ENABLE_DMX
100+
uint16_t dmxLength = dmxChannels + artnetOffset;
100101
// does not act on out-of-order packets yet
101102
if (e131ProxyUniverse > 0 && uni == e131ProxyUniverse) {
102-
for (uint16_t i = 1+artnetOffset; i <= dmxChannels+artnetOffset; i++)
103+
for (uint16_t i = 1+artnetOffset; i <= dmxLength; i++)
103104
dmx.write(i, e131_data[i]);
104105
dmx.update();
105106
}

0 commit comments

Comments
 (0)