From 1a513c7bbf819741478ae9e99ee86d1115cfaa06 Mon Sep 17 00:00:00 2001 From: Thomas <4719352+FUB4R@users.noreply.github.com> Date: Sat, 16 Apr 2022 23:08:27 +0100 Subject: [PATCH] wled.cpp: Wrap Serial calls in `#ifdef WLED_ENABLE_ADALIGHT`. (#2630) handleImprovPacket() unconditionally gobbles serial data which a problem if we want another feature to consume it. This patch uses the same guard as the existing call in `handleSerial()`. Co-authored-by: Thomas Fubar --- wled00/wled.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 69e58dfea..54c723c80 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -389,7 +389,9 @@ void WLED::setup() sprintf(mqttClientID + 5, "%*s", 6, escapedMac.c_str() + 6); } +#ifdef WLED_ENABLE_ADALIGHT if (Serial.available() > 0 && Serial.peek() == 'I') handleImprovPacket(); +#endif strip.service(); @@ -409,7 +411,10 @@ void WLED::setup() initDMX(); #endif +#ifdef WLED_ENABLE_ADALIGHT if (Serial.available() > 0 && Serial.peek() == 'I') handleImprovPacket(); +#endif + // HTTP server page init initServer();