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.

发送队列失败

Genius 3030 points


环境:

  1. SDK:simplelink_cc13x2_26x2_sdk_4_20_01_04
  2. IDE:Code Composer Studio, Version: 10.0.0.00010
  3. 例程:simple_peripheral_oad_offchip_CC26X2R1_LAUNCHXL_tirtos_ccs

新建了一个任务,使用如下方式创建队列:

    userMsgQueueHandle = Util_constructQueue(&userMsgQueue);

然后在定时器中周期发送队列,发送函数如下:

status_t user_task_enqueueMsg(UserEvent_e event, void *pData)
{
    uint8_t success;
    userEvt_t *pMsg = ICall_malloc(sizeof(userEvt_t));

    // Create dynamic pointer to message.
    if (pMsg)
    {
        pMsg->event = event;
        pMsg->pData = pData;

        // Enqueue the message.
        success = Util_enqueueMsg(userMsgQueueHandle, userEvent,
                                  (uint8_t*) pMsg);

        Debug("user_task_enqueueMsg = %s", success ?"SUCCESS":"FAILURE");
        return (success) ? SUCCESS : FAILURE;
    }

    return (bleMemAllocError);
}


Debug("user_task_enqueueMsg = %s", success ?"SUCCESS":"FAILURE"); 打印 “SUCCESS”

[10:14:58:683]user_task_enqueueMsg = SUCCESS
[10:14:58:688]
[10:14:59:683]SimplePeripheral_performPeriodicTask
[10:14:59:687]
[10:15:00:683]user_task_enqueueMsg = SUCCESS

为什么任务收不到队列消息呢?