NcpSpi: Improve the error handling on spinel SPI tx path (#1484)

In the unlikely case where `otPlatSpiSlavePrepareTransaction()` returns
a failure code it is ensured that the spinel frame is not removed from
the tx buffer and instead the task which prepares the next SPI send
frame is posted again.
This commit is contained in:
Abtin Keshavarzian
2017-03-17 22:20:47 -07:00
committed by Jonathan Hui
parent 523deb88a8
commit febcd2d9a4
2 changed files with 2 additions and 1 deletions
+2
View File
@@ -289,6 +289,8 @@ ThreadError NcpSpi::PrepareNextSpiSendFrame(void)
if (errorCode != kThreadError_None)
{
mTxState = kTxStateIdle;
mPrepareTxFrameTask.Post();
ExitNow();
}
// Remove the frame from tx buffer and inform the base
-1
View File
@@ -114,7 +114,6 @@ private:
uint8_t mEmptySendFrame[kSpiHeaderLength];
uint8_t mEmptyReceiveFrame[kSpiHeaderLength];
};
} // namespace Thread