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:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user