Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Networking/ESP8266WiFi/WiFiInterface.cpp')
-rw-r--r--src/Networking/ESP8266WiFi/WiFiInterface.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Networking/ESP8266WiFi/WiFiInterface.cpp b/src/Networking/ESP8266WiFi/WiFiInterface.cpp
index a990e15e..9e08438b 100644
--- a/src/Networking/ESP8266WiFi/WiFiInterface.cpp
+++ b/src/Networking/ESP8266WiFi/WiFiInterface.cpp
@@ -576,7 +576,7 @@ void WiFiInterface::Start() noexcept
transferAlreadyPendingCount = readyTimeoutCount = responseTimeoutCount = 0;
lastTickMillis = millis();
- lastState = 0;
+ lastDataReadyPinState = 0;
risingEdges = 0;
SetState(NetworkState::starting1);
}
@@ -614,14 +614,14 @@ void WiFiInterface::Spin() noexcept
{
case NetworkState::starting1:
{
- const bool currentState = digitalRead(EspDataReadyPin);
- if (currentState != lastState)
+ const bool currentDataReadyPinState = digitalRead(EspDataReadyPin);
+ if (currentDataReadyPinState != lastDataReadyPinState)
{
- if (currentState)
+ if (currentDataReadyPinState && risingEdges < 10)
{
risingEdges++;
}
- lastState = currentState;
+ lastDataReadyPinState = currentDataReadyPinState;
}
// The ESP toggles CS before it has finished starting up, so don't look at the CS signal too soon