Skip to content

Commit

Permalink
Don't recalculate length in every iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
askask committed Apr 4, 2024
1 parent 71418f6 commit 081a524
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wled00/e131.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){
uint8_t artnetOffset = (protocol == P_ARTNET) ? -1 : 0;

#ifdef WLED_ENABLE_DMX
uint16_t dmxLength = dmxChannels + artnetOffset;
// does not act on out-of-order packets yet
if (e131ProxyUniverse > 0 && uni == e131ProxyUniverse) {
for (uint16_t i = 1+artnetOffset; i <= dmxChannels+artnetOffset; i++)
for (uint16_t i = 1+artnetOffset; i <= dmxLength; i++)
dmx.write(i, e131_data[i]);
dmx.update();
}
Expand Down

0 comments on commit 081a524

Please sign in to comment.