浏览代码

[components][drivers][can]Init can tx completion flag before tx

cmbjxxiao 1 年之前
父节点
当前提交
6dd3802d0a
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      components/drivers/can/can.c

+ 1 - 0
components/drivers/can/can.c

@@ -154,6 +154,7 @@ rt_inline int _can_int_tx(struct rt_can_device *can, const struct rt_can_msg *da
 
         no = ((rt_uint32_t)tx_tosnd - (rt_uint32_t)tx_fifo->buffer) / sizeof(struct rt_can_sndbxinx_list);
         tx_tosnd->result = RT_CAN_SND_RESULT_WAIT;
+        rt_completion_init(&tx_tosnd->completion);
         if (can->ops->sendmsg(can, data, no) != RT_EOK)
         {
             /* send failed. */