Skip to content

Commit

Permalink
[posix] clear SPI tx buffer after usage
Browse files Browse the repository at this point in the history
This commit clear "mSpiTxPayloadSize" buffer once packet has been
successfully transmitted.
  • Loading branch information
hastigondaliya committed Oct 27, 2023
1 parent 1528c88 commit 1f9a124
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/posix/platform/spi_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1f9a124

Please sign in to comment.