diff --git a/cores/esp8266/HardwareSerial.cpp b/cores/esp8266/HardwareSerial.cpp index 194a0553e..5f7ea141c 100644 --- a/cores/esp8266/HardwareSerial.cpp +++ b/cores/esp8266/HardwareSerial.cpp @@ -133,7 +133,7 @@ unsigned long HardwareSerial::testBaudrate() unsigned long HardwareSerial::detectBaudrate(time_t timeoutMillis) { esp8266::polledTimeout::oneShotFastMs timeOut(timeoutMillis); - unsigned long detectedBaudrate; + unsigned long detectedBaudrate = 0; while (!timeOut) { if ((detectedBaudrate = testBaudrate())) { break;