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 <FUB4R@users.noreply.github.com>
This commit is contained in:
Thomas 2022-04-16 23:08:27 +01:00 committed by GitHub
parent d1f76042e1
commit 1a513c7bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();