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

Refactoring to PolledTimeout or optimistic_yield on the grounds that these are not wait loops on slow input.

This commit is contained in:
Dirk O. Kaar
2019-12-02 16:07:36 +01:00
parent 117f163099
commit f382fc9d77
5 changed files with 19 additions and 21 deletions

View File

@ -431,10 +431,9 @@ int8_t ESP8266WiFiSTAClass::waitForConnectResult(unsigned long timeoutLength) {
if((wifi_get_opmode() & 1) == 0) {
return WL_DISCONNECTED;
}
using esp8266::polledTimeout::oneShot;
oneShot timeout(timeoutLength); // number of milliseconds to wait before returning timeout error
using oneShotYieldMs = esp8266::polledTimeout::timeoutTemplate<false, esp8266::polledTimeout::YieldPolicy::YieldOrSkip>;
oneShotYieldMs timeout(timeoutLength); // number of milliseconds to wait before returning timeout error
while(!timeout) {
yield();
if(status() != WL_DISCONNECTED) {
return status();
}