From c5569a2a48b743c86df93ef6ad8bf3f512809617 Mon Sep 17 00:00:00 2001 From: mxklb Date: Tue, 31 Jan 2023 00:59:39 +0100 Subject: [PATCH] Optimized code & comments --- wled00/e131.cpp | 8 ++++---- wled00/wled.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wled00/e131.cpp b/wled00/e131.cpp index 181439ec..fa1cd37c 100644 --- a/wled00/e131.cpp +++ b/wled00/e131.cpp @@ -75,10 +75,10 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){ e131_data = p->property_values; seq = p->sequence_number; if (e131Priority != 0) { - // track lastest e131 package priority .. - if (p->priority >= lastPriority.get()) lastPriority.set(p->priority); - // skip packages < e131 config priority or < lastest priority - if (p->priority < e131Priority || p->priority < lastPriority.get()) return; + if (p->priority < e131Priority ) return; + // track highest priority & skip all lower priorities + if (p->priority >= highPriority.get()) highPriority.set(p->priority); + if (p->priority < highPriority.get()) return; } } else { //DDP realtimeIP = clientIP; diff --git a/wled00/wled.h b/wled00/wled.h index 086d7c53..d475e0d5 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -404,7 +404,7 @@ WLED_GLOBAL uint16_t e131ProxyUniverse _INIT(0); // output this WLED_GLOBAL uint16_t e131Universe _INIT(1); // settings for E1.31 (sACN) protocol (only DMX_MODE_MULTIPLE_* can span over consequtive universes) WLED_GLOBAL uint16_t e131Port _INIT(5568); // DMX in port. E1.31 default is 5568, Art-Net is 6454 WLED_GLOBAL byte e131Priority _INIT(0); // E1.31 port priority (if != 0 priority handling is active) -WLED_GLOBAL E131Priority lastPriority _INIT(3); // E1.31 latest priority tracking, init = timeout in seconds +WLED_GLOBAL E131Priority highPriority _INIT(3); // E1.31 highest priority tracking, init = timeout in seconds WLED_GLOBAL byte DMXMode _INIT(DMX_MODE_MULTIPLE_RGB); // DMX mode (s.a.) WLED_GLOBAL uint16_t DMXAddress _INIT(1); // DMX start address of fixture, a.k.a. first Channel [for E1.31 (sACN) protocol] WLED_GLOBAL uint16_t DMXSegmentSpacing _INIT(0); // Number of void/unused channels between each segments DMX channels