diff --git a/cores/esp8266/HardwareSerial.cpp b/cores/esp8266/HardwareSerial.cpp index 26383dd43e..4f09d26f40 100644 --- a/cores/esp8266/HardwareSerial.cpp +++ b/cores/esp8266/HardwareSerial.cpp @@ -146,7 +146,6 @@ unsigned long HardwareSerial::detectBaudrate(time_t timeoutMillis) if ((detectedBaudrate = testBaudrate())) { break; } - yield(); delay(100); } return detectedBaudrate; diff --git a/cores/esp8266/debug.cpp b/cores/esp8266/debug.cpp index f26316f0f4..06af1e424b 100644 --- a/cores/esp8266/debug.cpp +++ b/cores/esp8266/debug.cpp @@ -54,7 +54,7 @@ void hexdump(const void *mem, uint32_t len, uint8_t cols) } src += linesize; len -= linesize; - yield(); + optimistic_yield(10000); } os_printf("\n"); } diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp index 38f197c915..6255c4be86 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp @@ -431,10 +431,10 @@ 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 + // if probing doesn't trip, this yields + using oneShotYieldMs = esp8266::polledTimeout::timeoutTemplate; + oneShotYieldMs timeout(timeoutLength); // number of milliseconds to wait before returning timeout error while(!timeout) { - yield(); if(status() != WL_DISCONNECTED) { return status(); }