From f2c31eebb5306046c44227b72178e5b9490af7c4 Mon Sep 17 00:00:00 2001 From: armink Date: Wed, 19 Oct 2016 10:49:42 +0800 Subject: [PATCH] [DeviceDrivers]Fix dataqueue's bug when push data is timeout the lwm flag isn't reset. --- components/drivers/src/dataqueue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c index 1702d20710..f3247f6d30 100644 --- a/components/drivers/src/dataqueue.c +++ b/components/drivers/src/dataqueue.c @@ -119,7 +119,11 @@ rt_err_t rt_data_queue_push(struct rt_data_queue *queue, /* thread is waked up */ result = thread->error; level = rt_hw_interrupt_disable(); - if (result != RT_EOK) goto __exit; + if (result != RT_EOK) + { + queue->waiting_lwm = RT_FALSE; + goto __exit; + } } queue->queue[queue->put_index & mask].data_ptr = data_ptr; -- GitLab