mirror of
https://github.com/espressif/openthread.git
synced 2026-07-15 08:34:10 +00:00
Require radio driver to provide transmit and receive buffers. (#87)
Some radio chips have memory-mapped regions for transmit and receive buffers. This change allows the radio driver to pass those buffers, when available, directly to upper layers and avoid unnecessary copies.
This commit is contained in:
@@ -135,7 +135,7 @@ ThreadError Serial::ProcessCommand(void)
|
||||
int Serial::Output(const char *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
uint16_t remaining = kTxBufferSize - mTxLength;
|
||||
uint16_t tail = (mTxHead + mTxLength) % kTxBufferSize;
|
||||
uint16_t tail;
|
||||
|
||||
if (aBufLength > remaining)
|
||||
{
|
||||
@@ -170,7 +170,7 @@ void Serial::Send(void)
|
||||
{
|
||||
VerifyOrExit(mSendLength == 0, ;);
|
||||
|
||||
if (mTxHead + mTxLength > kTxBufferSize)
|
||||
if (mTxLength > kTxBufferSize - mTxHead)
|
||||
{
|
||||
mSendLength = kTxBufferSize - mTxHead;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user