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.

[参考译文] RTOS/CC2650STK:RTOS 时钟实例仅触发一次

Guru**** 2472440 points
Other Parts Discussed in Thread: CC2650

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/592058/rtos-cc2650stk-rtos-clock-instance-only-fires-once

器件型号:CC2650STK
Thread 中讨论的其他器件:CC2650

工具/软件:TI-RTOS

我将 CC2650 Launchpad 的 simple_broadcaster 示例用作我的基础项目、我希望实现一个时钟实例、该实例会在每几个时钟周期触发一个函数。 我正在使用 Util_constructClock()来执行此操作,但时钟实例只会触发一次。 该实例在 taskFxn 函数中定义、如下所示-  

静态空 SimpleBLEBroadcaster _taskFxn (UArg a0、UArg A1)
{
//初始化应用
SimpleBLEBroadcaster _init ();

//***时钟***

Util_constructClock (&pClock、Test_UpdateMajorMinor、2000、1000、false、 0);
Util_startClock (&pClock);

//应用程序主循环
用于(;)
{
//获取自启动以来的节拍数
uint32_t tickStart = Clock_getTicks();

//等待与调用线程关联的信号量。
//请注意、当发出信号时、与线程关联的信号量会发出信号
//消息在线程的消息接收队列中排队,或在何时排队
// iCall_signal ()函数被调用到信号量上。
iCall_errno errno = iCall_Wait (ICALL_TIMEOUT_FOREVAL);

if (errno =ICALL_errno_Success)
{
iCall_EntityID dest;
iCall_ServiceEnum src;
iCall_HciExtEvt *pMsg =空;

if (iCall_fetchServiceMsg (&src、&dest、
(void **)&pMsg)=ICALL_errno_Success)
{
IF (((src =ICALL_SERVICE_CLASS_BLE)&&(dest =self Entity))
{
//处理任务间消息
SimpleBLEBroadcaster _processStackMsg ((iCall_HDR *) pMsg);
}

if (pMsg)
{
iCall_freeMsg (pMsg);
}
}

//如果 RTOS 队列不为空,则处理应用程序消息。
while (!Queue_empty (appMsgQueue))
{
sbbEvt_t *pMsg =(sbbEvt_t *) Util_dequeueMsg (appMsgQueue);
if (pMsg)
{
//处理消息。
SimpleBLEBroadcaster _processAppMsg (pMsg);

//从消息中释放空间。
iCall_free (pMsg);
}
}

}

我还尝试在 init()函数中使用 clock 函数,但它仍然执行相同的操作。 被调用的函数(Test_UpdateMajorMinor())只是一个关闭并打开板载 LED 的测试函数。 这里的问题是什么?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Jay、

    SimpleLink Academy 中有一个在低功耗蓝牙自定义配置文件实验的任务6中创建时钟对象的示例。 您可以尝试执行此处的步骤吗?