From 70136e20aa48567cc624440e5c01458803e7023e Mon Sep 17 00:00:00 2001 From: helgeerbe Date: Thu, 11 Aug 2022 20:40:52 +0200 Subject: [PATCH] yield 100ms --- src/MqttVedirectPublishing.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/MqttVedirectPublishing.cpp b/src/MqttVedirectPublishing.cpp index d83e89c3..20a8f80c 100644 --- a/src/MqttVedirectPublishing.cpp +++ b/src/MqttVedirectPublishing.cpp @@ -30,7 +30,11 @@ void MqttVedirectPublishingClass::loop() bool bChanged; unsigned long now = millis(); - while ( Serial2.available() && ((millis() - now) < 500)) { + while ( Serial2.available()) { + if ((millis() - now) > 100) { + now = millis(); + yield(); + } _myve.rxData(Serial2.read()); } yield();