diff options
author | Christian Hammacher <bmasterc@gmail.com> | 2021-10-28 15:10:22 +0300 |
---|---|---|
committer | Christian Hammacher <bmasterc@gmail.com> | 2021-10-28 15:10:22 +0300 |
commit | 5e44de8b0a7782670cb014c37e09f3af7d4b7b07 (patch) | |
tree | bf7035f0010d4bb5e6b0ba1e8463c918c64e3343 | |
parent | 4f218659e714355d7d2c79bc5d455323ab463081 (diff) |
Fixed possible bug in the SBC interface
SBC interface could hang if two successive connection resets occurred
-rw-r--r-- | src/SBC/SbcInterface.cpp | 7 |
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); } } } |