这个问题帖中讲,该SP_PERIODIC_EVT事件是预期的,请问是什么意思?哪个任务每500ms调用一次的?
谢谢!
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.
您好,
预期是指无意外应该会发生的。
调用了SP_PERIODIC_EVT事件,每5000ms执行一次
// 參考流程圖中的數字2
// 參考剛剛建立定時器時候的第二個和第五個參數
// 當時間到的時候,就會呼叫SimplePeripheral_clockHandler這個函式
// 並且把 SP_PERIODIC_EVT 當作參數代入
static void SimplePeripheral_clockHandler(UArg arg)
{
spClockEventData_t *pData = (spClockEventData_t *)arg;
// 這邊會取出參數,判斷是否為定時器的事件
if (pData->event == SP_PERIODIC_EVT)
{
// 因為現在這段程式是執行在軟體中斷的執行緒,
// 我們不可以在這邊做太多事情,
// 所以只把"定時器到期"這個訊息放到佇列(Queue)中。
SimplePeripheral_enqueueMsg(SP_PERIODIC_EVT, NULL);
}
}
SimplePeripheral_enqueueMsg(SP_PERIODIC_EVT, NULL);
不是很明确你的问题背景,可以给出更多信息吗?
你目前只在进行simple_peripheral吗?
目前看你post出来的code,最后一个参数就是 :
- 传递给回调函数的参数。 |
1,false 确实是
- TRUE 立即开始,FALSE 等待。 |
没有立即开启,等待一定时间开启,你应该需要调用Util_startClock()
2.
#define SP_PERIODIC_EVT 6
// Application events #define SP_STATE_CHANGE_EVT 0 #define SP_CHAR_CHANGE_EVT 1 #define SP_KEY_CHANGE_EVT 2 #define SP_ADV_EVT 3 #define SP_PAIR_STATE_EVT 4 #define SP_PASSCODE_EVT 5 #define SP_PERIODIC_EVT 6 #define SP_READ_RPA_EVT 7 #define SP_SEND_PARAM_UPDATE_EVT 8 #define SP_CONN_EVT 9 #define APP_MSG_SC_TASK_ALERT 0x0099
Clock functions must not call blocking kernel APIs or TI-RTOS driver APIs! Executing long routines will impact real-time constraints placed in high priority tasks allocated for wireless protocol stacks!
认为可能是调用了blocking or TI-RTIOS API导致的
如果你并未进行任何修改的话,那应该是在之前对开发板进行类似广播或者其他在BLE STACK中的操作,导致这样,并且请考虑事件的优先级
periodicClock
Clock 对象(步骤三)。
hi,
我找到原因了。
log出来的信息会打印APP_PERIODIC_EVT是因为appEventStrings[]把APP_READ_RPA_EVT和APP_PERIODIC_EVT顺序搞错了;
本应该是 appEventStrings[7] = " APP_READ_RPA_EVT " ,appEventStrings[6] = " APP_PERIODIC_EVT " ,
所以实际上启动的是读取RPA的定时器。
我用的SDK版本是simplelink_cc13xx_cc26xx_sdk_7_10_00_98->simple_peripheral_CC26X2R1_LAUNCHXL_tirtos7_ticlang;
谢谢!