Texas Instruments CC2650DK ユーザーズマニュアル

ページ / 1570
Data Queue Usage
23.4.1.4 PROC_ALLOCATE_RX: Allocate RX Buffer for Storing Data
Pointer to queue, pQueue
Size of entry element to store, size
The procedure returns the following:
Pointer to data entry where data is stored, pEntry
Pointer to a finished data entry, or NULL if not finished; pFinishedEntry
The procedure returns with error if the first entry of the queue is already busy. If there is not room for an
entry element of the specified size, including if the queue is empty, a “no space” error is returned. The
following procedure describes the operations:
Set pFinishedEntry == NULL
If pQueue->pCurrEntry == NULL then
Return with no space error
end if
If pQueue->pCurrEntry->type != 1 then
if pQueue->pCurrEntry->length < size then
Return with no space error
else
Set pQueue->pCurrEntry->status = Busy
Set pEntry = pQueue->pCurrEntry
end if
else
Set pTemp = pQueue->pCurrEntry
If pTemp->nextIndex + 2 + size > pTemp->length then
Set pQueue->pCurrEntry = pTemp->pNextEntry
Set pTemp->status = Finished
Set pFinishedEntry = pTemp
Set pTemp = pTemp->pNextEntry
If pTemp == NULL or pTemp->length < size + 2 then
Return with no space error
end if
end if
Set pTemp->status = Busy
Set pEntry = pTemp
end if
1492
Radio
SWCU117A – February 2015 – Revised March 2015
Copyright © 2015, Texas Instruments Incorporated