Hi champion,
My customer is looking at the mmwave demo in mmwave_sdk_01_00_00_05. I got a question about the MMWave_spawn funciton in the code. This function is registered to rlDevicePowerOn in below code.
/* Initialize OSI Queue Interface */
RlApp_ClientCtx.osiCb.queue.rlOsiSpawn = &MMWave_spawn;
- Inside this function it saved input function point and parameter in gMMWave_MCB.ptrSpawnFxnFreeList, and then post a semaphore to other task. My questiton is when
MMWave_spawn is called and what is the funciton point and parameter it used.
static rlInt32_t MMWave_spawn
(
RL_P_OSI_SPAWN_ENTRY fxn,
const void* pValue,
uint32_t flags
)
{
MMWave_SpawnFxnNode* ptrSpawnFxnNode;
uintptr_t key;
int32_t retVal = 0;
/* Critical Section: The spawn free list is a critical resource which is accessed
* from multiple contexts */
key = HwiP_disable();
ptrSpawnFxnNode = (MMWave_SpawnFxnNode*)MMWave_listRemove ((MMWave_ListNode**)&gMMWave_MCB.ptrSpawnFxnFreeList);
HwiP_restore (key);
/* Did we get an entry? */
if (ptrSpawnFxnNode != NULL)
{
/* YES: Populate the entry */
ptrSpawnFxnNode->spawnEntry = fxn;
ptrSpawnFxnNode->arg = pValue;
/* Critical Section: The spawn active list is a critical resource which is accessed
* from multiple contexts */
key = HwiP_disable();
MMWave_listAdd ((MMWave_ListNode**)&gMMWave_MCB.ptrSpawnFxnActiveList, (MMWave_ListNode*)ptrSpawnFxnNode);
HwiP_restore (key);
/* Keep track of the number of spawn messages which have been received */
gMMWave_MCB.spawnCounter++;
/* Wake up the mmWave execution thread */
SemaphoreP_post (gMMWave_MCB.linkSemHandle);
}
else
{
/* Error: No span free node was present. This can happen if all the spawn functions
* have been taken up and the execute mmWave control API has not been invoked. Increment
* statistics to report this condition */
gMMWave_MCB.spawnOverflow++;
/* Setup the return value to indicate an error. */
retVal = -1;
}
return retVal;
}
2. why we define the spwan list size to 4 (MMWAVE_MAX_NUM_SPAWN_LIST)? In which case we need to use this list to save more than one funciton call.