Browse Source

[DeviceDrivers]Fix dataqueue's bug when push data is timeout the lwm flag isn't reset.

armink 8 năm trước cách đây
mục cha
commit
f2c31eebb5

+ 5 - 1
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 */
         /* thread is waked up */
         result = thread->error;
         result = thread->error;
         level = rt_hw_interrupt_disable();
         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;
     queue->queue[queue->put_index & mask].data_ptr  = data_ptr;