cc2640串口消息传递问题

2019-07-18 15:08发布

cc2640的任务间传递消息,我这么写有么有问题啊,这个是npi_task里的

这个是SimpleBLEPeripheral.c里的一个消息队列

我想npi_task.c中将串口消息发到SimpleBLEPeripheral.c这个任务中

static void Serail_enqueueMsg(uint8_t event, uint8_t *str)

{

  sbpEvt_t *pMsg;

  // Create dynamic pointer to message.

  if (pMsg = ICall_malloc(sizeof(sbpEvt_t)))

  {

    pMsg->event = event;

    pMsg->value = str;

    // Enqueue the message.

    Util_enqueueMsg(appMsgQueue, sem, (uint8*)pMsg);

    UartWrite("send ",6);

  }  

}



友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
1条回答
云中云
1楼-- · 2019-07-18 17:51
理论上是可以的。关键是你要把appMsgQueue 和 sem连接到app的task的queue和sem上去

一周热门 更多>