Timeout for HardwareSerial 500ms
This commit is contained in:
parent
6ca3fb61ce
commit
0793856259
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user