From 7571c729f599bac9159c0261d7b62e731f16516d Mon Sep 17 00:00:00 2001 From: "Dirk O. Kaar" Date: Sun, 8 Mar 2020 19:18:49 +0100 Subject: [PATCH] Revert change after review comments. --- libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp | 2 +- .../ESP8266WiFiMesh/src/ESP8266WiFiMesh.cpp | 30 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp b/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp index 7f1ddc5348..e03ab072e2 100644 --- a/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp +++ b/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp @@ -281,7 +281,7 @@ uint8_t ESP8266AVRISP::write_flash_pages(int length) { int x = 0; int page = addr_page(here); while (x < length) { - optimistic_yield(10000); + yield(); if (page != addr_page(here)) { commit(page); page = addr_page(here); diff --git a/libraries/ESP8266WiFiMesh/src/ESP8266WiFiMesh.cpp b/libraries/ESP8266WiFiMesh/src/ESP8266WiFiMesh.cpp index 9a00b45856..5775fa3009 100644 --- a/libraries/ESP8266WiFiMesh/src/ESP8266WiFiMesh.cpp +++ b/libraries/ESP8266WiFiMesh/src/ESP8266WiFiMesh.cpp @@ -150,7 +150,7 @@ IPAddress ESP8266WiFiMesh::getStaticIP() void ESP8266WiFiMesh::disableStaticIP() { WiFi.config(0u,0u,0u); - optimistic_yield(10000); + yield(); staticIPActivated = false; } @@ -185,9 +185,9 @@ void ESP8266WiFiMesh::deactivateAP() void ESP8266WiFiMesh::restartAP() { deactivateAP(); - optimistic_yield(10000); + yield(); activateAP(); - optimistic_yield(10000); + yield(); } ESP8266WiFiMesh * ESP8266WiFiMesh::getAPController() @@ -331,9 +331,9 @@ bool ESP8266WiFiMesh::latestTransmissionSuccessful() void ESP8266WiFiMesh::fullStop(WiFiClient &currClient) { currClient.stop(); - optimistic_yield(10000); + yield(); WiFi.disconnect(); - optimistic_yield(10000); + yield(); } /** @@ -375,7 +375,7 @@ transmission_status_t ESP8266WiFiMesh::exchangeInfo(WiFiClient &currClient) verboseModePrint("Transmitting"); // Not storing strings in flash (via F()) to avoid performance impacts when using the string. currClient.print(getMessage() + '\r'); - optimistic_yield(10000); + yield(); if (!waitForClientTransmission(currClient, _stationModeTimeoutMs)) { @@ -390,7 +390,7 @@ transmission_status_t ESP8266WiFiMesh::exchangeInfo(WiFiClient &currClient) } String response = currClient.readStringUntil('\r'); - optimistic_yield(10000); + yield(); currClient.flush(); /* Pass data to user callback */ @@ -443,7 +443,7 @@ transmission_status_t ESP8266WiFiMesh::attemptDataTransferKernel() } currClient.stop(); - optimistic_yield(10000); + yield(); return transmissionOutcome; } @@ -476,7 +476,7 @@ transmission_status_t ESP8266WiFiMesh::connectToNode(const String &targetSSID, i WiFiMode_t storedWiFiMode = WiFi.getMode(); WiFi.mode(WIFI_OFF); WiFi.mode(storedWiFiMode); - optimistic_yield(10000); + yield(); #else // Disable static IP so that we can connect to other servers via DHCP (DHCP is slower but required for connecting to more than one server, it seems (possible bug?)). @@ -500,7 +500,7 @@ transmission_status_t ESP8266WiFiMesh::connectToNode(const String &targetSSID, i { verboseModePrint(F("... "), false); WiFi.disconnect(); - optimistic_yield(10000); + yield(); initiateConnectionToAP(targetSSID, targetChannel, targetBSSID); attemptNumber++; } @@ -527,7 +527,7 @@ void ESP8266WiFiMesh::attemptTransmission(const String &message, bool concluding if(initialDisconnect) { WiFi.disconnect(); - optimistic_yield(10000); + yield(); } latestTransmissionOutcomes.clear(); @@ -565,7 +565,7 @@ void ESP8266WiFiMesh::attemptTransmission(const String &message, bool concluding for(NetworkInfo ¤tNetwork : connectionQueue) { WiFi.disconnect(); - optimistic_yield(10000); + yield(); String currentSSID; int currentWiFiChannel = NETWORK_INFO_DEFAULT_INT; @@ -614,7 +614,7 @@ void ESP8266WiFiMesh::attemptTransmission(const String &message, bool concluding if(concludingDisconnect) { WiFi.disconnect(); - optimistic_yield(10000); + yield(); } } @@ -658,7 +658,7 @@ void ESP8266WiFiMesh::acceptRequest() /* Read in request and pass it to the supplied requestHandler */ String request = _client.readStringUntil('\r'); - optimistic_yield(10000); + yield(); _client.flush(); String response = _requestHandler(request, *this); @@ -669,7 +669,7 @@ void ESP8266WiFiMesh::acceptRequest() verboseModePrint("Responding"); // Not storing strings in flash (via F()) to avoid performance impacts when using the string. _client.print(response + '\r'); _client.flush(); - optimistic_yield(10000); + yield(); } } }