[posix] clear SPI tx buffer after usage (#9567)

This commit clear "mSpiTxPayloadSize" buffer once packet has been
successfully transmitted.
This commit is contained in:
hastigondaliya
2023-11-20 11:33:51 -08:00
committed by GitHub
parent ece7943a0e
commit 0bb9eeb500
+2
View File
@@ -569,6 +569,8 @@ otError SpiInterface::PushPullSpi(void)
mInterfaceMetrics.mTxFrameCount++;
mInterfaceMetrics.mTxFrameByteCount += mSpiTxPayloadSize;
// Clear tx buffer after usage
memset(&mSpiTxFrameBuffer[kSpiFrameHeaderSize], 0, mSpiTxPayloadSize);
mSpiTxIsReady = false;
mSpiTxPayloadSize = 0;
mSpiTxRefusedCount = 0;