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
path: root/src/SBC
diff options
context:
space:
mode:
authorChristian Hammacher <bmasterc@gmail.com>2021-10-28 15:10:22 +0300
committerChristian Hammacher <bmasterc@gmail.com>2021-10-28 15:10:22 +0300
commit5e44de8b0a7782670cb014c37e09f3af7d4b7b07 (patch)
treebf7035f0010d4bb5e6b0ba1e8463c918c64e3343 /src/SBC
parent4f218659e714355d7d2c79bc5d455323ab463081 (diff)
Fixed possible bug in the SBC interface
SBC interface could hang if two successive connection resets occurred
Diffstat (limited to 'src/SBC')
-rw-r--r--src/SBC/SbcInterface.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/SBC/SbcInterface.cpp b/src/SBC/SbcInterface.cpp
index 73cfb885..691ba401 100644
--- a/src/SBC/SbcInterface.cpp
+++ b/src/SBC/SbcInterface.cpp
@@ -148,9 +148,6 @@ void SbcInterface::Spin() noexcept
{
// Let the main task invalidate resources before processing new data
TaskBase::Take(SbcYieldTimeout);
-
- // Reset the SPI connection again
- transfer.ResetConnection(false);
}
}
@@ -167,10 +164,10 @@ void SbcInterface::Spin() noexcept
ExchangeData();
transfer.StartNextTransfer();
}
- else if (hadTimeout)
+ else if (hadTimeout || hadReset)
{
// Reset the SPI connection if no data could be exchanged
- transfer.ResetConnection(true);
+ transfer.ResetConnection(hadTimeout);
}
}
}