Part Number:LAUNCHXL-CC1352R1
* \b Important: Unlike the ALERT event, the READY event does not generate MCU domain and System CPU
* wake-up. Depending on the SCIF OSAL implementation, this function might not return before the
* specified timeout expires, even if the READY event has occurred long before that. To avoid such
* delays, call \c fwGenAlertInterrupt() from the task code block that \ref scifWaitOnNbl() is waiting
* for to complete.
請問" call \c fwGenAlertInterrupt() from the task code block that \ref scifWaitOnNbl() is waiting for to complete." 此句的用意是?
看起來是要在sensor controller studio中, 加入fwGenAlertInterrupt() .
但是要怎麼跟scifWaitOnNbl() is waiting for to complete有相關聯呢?
Cherry Zhou:
您好我们已收到您的问题并升级到英文论坛寻求帮助,链接如下,如有答复将尽快回复您。谢谢!
e2e.ti.com/…/launchxl-cc1352r1-scifwaitonnbl
,
Cherry Zhou:
Hi,
方便补充一下上下文吗?您是在哪个project中找到这一部分的?
,
Hugh:
此段是出現在scif_framework.c中的 scifWaitOnNbl function
在multi_sensor_CC1352R1_LAUNCHXL_tirtos_ccs可以找到
Drivers->ACCELEROMETER->scif_framework.c
/** \brief Waits for a non-blocking call to complete, with timeout * * The non-blocking task control functions, \ref scifExecuteTasksOnceNbl(), \ref scifStartTasksNbl() * and \ref scifStopTasksNbl(), may take some time to complete. This wait function can be used to make * blocking calls, and allow an operating system to switch context when until the task control interface * becomes ready again. * * The function returns when the last non-blocking call has completed, or immediately if already * completed. The function can also return immediately with the \ref SCIF_ILLEGAL_OPERATION error if * called from multiple threads of execution with non-zero \a timeoutUs. * * \b Important: Unlike the ALERT event, the READY event does not generate MCU domain and System CPU * wake-up. Depending on the SCIF OSAL implementation, this function might not return before the * specified timeout expires, even if the READY event has occurred long before that. To avoid such * delays, call \c fwGenAlertInterrupt() from the task code block that \ref scifWaitOnNbl() is waiting * for to complete. * * \param[in] timeoutUs * Maximum number of microseconds to wait for the non-blocking functions to become available. Use a * timeout of "0" to check whether the interface already is available, or simply call the control * function (which also will return \ref SCIF_NOT_READY if not ready). * * \return * \ref SCIF_SUCCESS if the last call has completed, otherwise \ref SCIF_NOT_READY (the timeout * expired) or \ref SCIF_ILLEGAL_OPERATION (the OSAL does not allow this function to be called with * non-zero \a timeoutUs from multiple threads of execution). */SCIF_RESULT_T scifWaitOnNbl(uint32_t timeoutUs) { if (HWREG(AUX_EVCTL_BASE + AUX_EVCTL_O_EVTOAONFLAGS) & AUX_EVCTL_EVTOAONFLAGS_SWEV0_M) { return SCIF_SUCCESS; } else { return osalWaitOnCtrlReady(timeoutUs); }} // scifWaitOnNbl
,
Cherry Zhou:
好的我们跟进给工程师看下。
,
Cherry Zhou:
您好,
任务控制函数 scifExecuteTasksOnceNbl()不会阻止执行并立即返回。 但一次性只能调用这些函数一次:
例如,不能连续两次调用 scifExecuteTasksOnceNbl(),而不在两次调用之间等待。 在这两个呼叫之间等待 scifWaitOnNbl (timeout)。
当 CPU 等待 scifWaitOnNbl()时,可能进入睡眠状态。 如果sensor controller仅发布一个READY event并且需要一个ALERT event来唤醒,那么CPU 不会被唤醒。
如果 scifExecuteTasksOnceNbl()所调用任务的sensor controller代码中没有 fwGenAlertInterrupt(),则该任务仅生成READY event,因此 CPU 仅在timeout时唤醒。 但是该任务可能在这个timeout之前就已经完成执行。
如果您希望sensor controller上的任务完成后 CPU 立即唤醒,则可以让 fwGenAlertInterrupt()生成ALERT event。 这将唤醒 CPU。