浏览代码

fix dataqueue, limit queue size to usable values (2,4,8,16...) to avoid errors when put_index exceed 0xffff.

qiyongzhong0 4 年之前
父节点
当前提交
c16c5b968f
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      components/drivers/src/dataqueue.c

+ 1 - 0
components/drivers/src/dataqueue.c

@@ -28,6 +28,7 @@ rt_data_queue_init(struct rt_data_queue *queue,
                    void (*evt_notify)(struct rt_data_queue *queue, rt_uint32_t event))
 {
     RT_ASSERT(queue != RT_NULL);
+    RT_ASSERT((0x10000 % size) == 0);
 
     queue->evt_notify = evt_notify;