mirror of
https://github.com/espressif/openthread.git
synced 2026-09-18 23:20:08 +00:00
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:
committed by
Jonathan Hui
parent
523deb88a8
commit
febcd2d9a4
@@ -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
|
||||
|
||||
@@ -114,7 +114,6 @@ private:
|
||||
|
||||
uint8_t mEmptySendFrame[kSpiHeaderLength];
|
||||
uint8_t mEmptyReceiveFrame[kSpiHeaderLength];
|
||||
|
||||
};
|
||||
|
||||
} // namespace Thread
|
||||
|
||||
Reference in New Issue
Block a user