我在6.10 SDK 上,我正在尝试使用 EasyLink_setFrequency 函数来动态更改频率。
可悲的是,该函数总是返回 EasyLink_Status_Busy_Error ,并使用以下代码:
//Check and take the busyMutex
if (Semaphore_pend(busyMutex, 0) == false)
{
return EasyLink_Status_Busy_Error;
}
我该怎么办?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我在6.10 SDK 上,我正在尝试使用 EasyLink_setFrequency 函数来动态更改频率。
可悲的是,该函数总是返回 EasyLink_Status_Busy_Error ,并使用以下代码:
//Check and take the busyMutex
if (Semaphore_pend(busyMutex, 0) == false)
{
return EasyLink_Status_Busy_Error;
}
我该怎么办?
Michael、您好!
我看到所有 API 都使用 busyMutex。 基本上、如果要执行 EasyLink_Transmit 或任何其他命令、此 if 语句只检查一次、没有超时、立即返回、而不进行阻止。
您可以重新提交命令、直到成功。 或者、你可以给该 API 的 Semaphore_pend 添加一个超时。
此超时将阻止此 API 的返回、直到您获得信标。 当然、您需要考虑这可能在您的应用中导致的时序复杂性。
此致、
SID