Skip to content

Commit

Permalink
yield 100ms
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Aug 11, 2022
1 parent 47dda55 commit 70136e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/MqttVedirectPublishing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 70136e2

Please sign in to comment.