Timeout for HardwareSerial 500ms

This commit is contained in:
helgeerbe 2022-08-11 09:42:36 +02:00
parent 6ca3fb61ce
commit 0793856259

View File

@ -28,8 +28,9 @@ void MqttVedirectPublishingClass::loop()
String key;
String value;
bool bChanged;
unsigned long now = millis();
while ( Serial2.available() ) {
while ( Serial2.available() && ((millis() - now) < 500)) {
_myve.rxData(Serial2.read());
}
yield();