主题中讨论的其他器件:CC1125、 CC1312R7
您好!
Im´基于 CC1312R7开发应用 μ P、以替代基于 CC1125+MCU 的旧系统。
´ve 代码的移植几乎是完成的、但我发现如果在短时间内发送多条消息、程序将卡在以下位置:
RF_EventMask terminationReason = RF_runCmd (rfHandle、(RF_Op*)&RF_cmdPropTx、 RF_PriorityNormal、NULL、0);
在其内部、它卡在 SemaphoreP_pend 函数的 while 循环中、在这个 while 循环中没有退出:
SemaphoreP_Status SemaphoreP_pend(SemaphoreP_Handle handle, uint32_t timeout)
{
SemaphoreP_Obj *pSemaphore = (SemaphoreP_Obj *)handle;
SemaphoreP_Status status;
ClockP_Struct clockStruct;
uintptr_t key;
/*
* Always add Clock (but don't start) so that ClockP_isActive() below
* is valid. It's OK to add a Clock even when timeout is 0 or forever
* (but it is not OK to start it).
*/
ClockP_add(&clockStruct, clkFxn, timeout, (uintptr_t)NULL);
if ((timeout != 0) && (timeout != SemaphoreP_WAIT_FOREVER))
{
ClockP_start((ClockP_Handle)&clockStruct);
}
key = HwiP_disable();
pendInProgress = true;
while ((pSemaphore->count == 0) &&
((timeout == SemaphoreP_WAIT_FOREVER) || ClockP_isActive((ClockP_Handle)&clockStruct)))
{
/* HwiP must be disabled while checking the loop-condition and calling the callback function.
* Otherwise, the count could increase at this point, and no further interrupts occur to
* wake up the CPU and proceed from the callback.
*/
/* Call the registered callback */
if (pSemaphore->params.callback != NULL)
{
pSemaphore->params.callback();
}
HwiP_restore(key);
if (doEnablePolicy)
{
Power_enablePolicy();
doEnablePolicy = false;
}
key = HwiP_disable();
}
pendInProgress = false;
if (pSemaphore->count > 0)
{
(pSemaphore->count)--;
status = SemaphoreP_OK;
}
else
{
status = SemaphoreP_TIMEOUT;
}
HwiP_restore(key);
ClockP_destruct(&clockStruct);
return (status);
}
通过无线电发送和接收的代码基于未进行修改、 没有 RTOS 的示例 UARTBridge。