summaryrefslogtreecommitdiff
path: root/components/drivers/src
diff options
context:
space:
mode:
authorqiyongzhong0 <[email protected]>2020-08-30 14:35:09 +0800
committerqiyongzhong0 <[email protected]>2020-08-30 14:35:09 +0800
commitc16c5b968f7dd52d48749ad647d8ef7415b07efc (patch)
treeb04b26bda688918878433a0324f262303fc3398a /components/drivers/src
parent5495e6447d097737c6a8dd3fe4ffcd85f483499b (diff)
fix dataqueue, limit queue size to usable values (2,4,8,16...) to avoid errors when put_index exceed 0xffff.
Diffstat (limited to 'components/drivers/src')
-rw-r--r--components/drivers/src/dataqueue.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c
index 5a802c0711..ba4a921da0 100644
--- a/components/drivers/src/dataqueue.c
+++ b/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;