Skip to content

Commit

Permalink
Revert change after review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
dok-net committed May 18, 2021
1 parent 95b06ce commit 7571c72
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
30 changes: 15 additions & 15 deletions libraries/ESP8266WiFiMesh/src/ESP8266WiFiMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ IPAddress ESP8266WiFiMesh::getStaticIP()
void ESP8266WiFiMesh::disableStaticIP()
{
WiFi.config(0u,0u,0u);
optimistic_yield(10000);
yield();
staticIPActivated = false;
}

Expand Down Expand Up @@ -185,9 +185,9 @@ void ESP8266WiFiMesh::deactivateAP()
void ESP8266WiFiMesh::restartAP()
{
deactivateAP();
optimistic_yield(10000);
yield();
activateAP();
optimistic_yield(10000);
yield();
}

ESP8266WiFiMesh * ESP8266WiFiMesh::getAPController()
Expand Down Expand Up @@ -331,9 +331,9 @@ bool ESP8266WiFiMesh::latestTransmissionSuccessful()
void ESP8266WiFiMesh::fullStop(WiFiClient &currClient)
{
currClient.stop();
optimistic_yield(10000);
yield();
WiFi.disconnect();
optimistic_yield(10000);
yield();
}

/**
Expand Down Expand Up @@ -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))
{
Expand All @@ -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 */
Expand Down Expand Up @@ -443,7 +443,7 @@ transmission_status_t ESP8266WiFiMesh::attemptDataTransferKernel()
}

currClient.stop();
optimistic_yield(10000);
yield();

return transmissionOutcome;
}
Expand Down Expand Up @@ -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?)).
Expand All @@ -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++;
}
Expand All @@ -527,7 +527,7 @@ void ESP8266WiFiMesh::attemptTransmission(const String &message, bool concluding
if(initialDisconnect)
{
WiFi.disconnect();
optimistic_yield(10000);
yield();
}

latestTransmissionOutcomes.clear();
Expand Down Expand Up @@ -565,7 +565,7 @@ void ESP8266WiFiMesh::attemptTransmission(const String &message, bool concluding
for(NetworkInfo &currentNetwork : connectionQueue)
{
WiFi.disconnect();
optimistic_yield(10000);
yield();

String currentSSID;
int currentWiFiChannel = NETWORK_INFO_DEFAULT_INT;
Expand Down Expand Up @@ -614,7 +614,7 @@ void ESP8266WiFiMesh::attemptTransmission(const String &message, bool concluding
if(concludingDisconnect)
{
WiFi.disconnect();
optimistic_yield(10000);
yield();
}
}

Expand Down Expand Up @@ -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);
Expand All @@ -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();
}
}
}
Expand Down

0 comments on commit 7571c72

Please sign in to comment.