Timeout for HardwareSerial 500ms

This commit is contained in:
helgeerbe 2022-08-11 09:42:36 +02:00
parent c889efef7c
commit e43a45b979

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