Skip to content

Commit c16c5b9

Browse files
committed
fix dataqueue, limit queue size to usable values (2,4,8,16...) to avoid errors when put_index exceed 0xffff.
1 parent 5495e64 commit c16c5b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

components/drivers/src/dataqueue.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ rt_data_queue_init(struct rt_data_queue *queue,
2828
void (*evt_notify)(struct rt_data_queue *queue, rt_uint32_t event))
2929
{
3030
RT_ASSERT(queue != RT_NULL);
31+
RT_ASSERT((0x10000 % size) == 0);
3132

3233
queue->evt_notify = evt_notify;
3334

0 commit comments

Comments
 (0)