1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-13 13:01:55 +03:00

Fix optimistic_yield usage (#588)

This commit is contained in:
Ivan Grokhotkov
2015-07-22 22:50:26 +03:00
parent a9d5ef198a
commit 11594b1340
2 changed files with 14 additions and 7 deletions

View File

@ -122,6 +122,12 @@ int WiFiUDP::available() {
result = static_cast<int>(_ctx->getSize());
}
if (!result) {
// yielding here will not make more data "available",
// but it will prevent the system from going into WDT reset
optimistic_yield(1000);
}
return result;
}