From 4903ec6bb99d7957f7e195b0ea9b1a0c064d32bf Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 18 Feb 2023 13:33:38 +0000 Subject: [PATCH] Pass data from DMX to existing universe handling code --- wled00/dmx.cpp | 3 ++- wled00/e131.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wled00/dmx.cpp b/wled00/dmx.cpp index c2a8d9b6..6febf1ec 100644 --- a/wled00/dmx.cpp +++ b/wled00/dmx.cpp @@ -102,6 +102,7 @@ void initDMX() {} void handleDMXInput() { dmx.update(); dmx.read(1); // TODO - handle code - DEBUG_PRINTF("DMX channel 1 = %u", dmx.read(1)); // TODO: remove from final code + handleDMXData(1, 512, e131_data, 1, REALTIME_MODE_DMX); + DEBUG_PRINTF("DMX channel 1 = %u\n", dmx.read(1)); // TODO: remove from final code } #endif \ No newline at end of file diff --git a/wled00/e131.cpp b/wled00/e131.cpp index e4c3fabb..057e354d 100644 --- a/wled00/e131.cpp +++ b/wled00/e131.cpp @@ -79,7 +79,9 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){ handleDDPPacket(p); return; } - + handleDMXData(uni, dmxChannels, e131_data, seq, mde); +} +void handleDMXData(uint16_t uni, uint16_t dmxChannels, uint8_t* e131_data, uint8_t seq, uint8_t mde) { #ifdef WLED_ENABLE_DMX // does not act on out-of-order packets yet if (e131ProxyUniverse > 0 && uni == e131ProxyUniverse) {