From bda654330567a62695ae365b56d31512ba301ad3 Mon Sep 17 00:00:00 2001 From: armink Date: Sat, 29 Oct 2016 14:35:07 +0800 Subject: [PATCH] [DeviceDrivers]Fix dataqueue irq not resume bug. --- components/drivers/src/dataqueue.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c index c47eeefee9..dc265fb66d 100644 --- a/components/drivers/src/dataqueue.c +++ b/components/drivers/src/dataqueue.c @@ -117,11 +117,7 @@ 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) - { - queue->waiting_lwm = RT_FALSE; - goto __exit; - } + if (result != RT_EOK) goto __exit; } queue->queue[queue->put_index % queue->size].data_ptr = data_ptr; @@ -244,6 +240,10 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue, /* perform a schedule */ rt_schedule(); } + else + { + rt_hw_interrupt_enable(level); + } if (queue->evt_notify != RT_NULL) queue->evt_notify(queue, RT_DATAQUEUE_EVENT_LWM); -- GitLab