From f3d3e9d2fdc2c0ac9ca3af3e9ad2ab9377f49508 Mon Sep 17 00:00:00 2001 From: Zhixing Zhang Date: Sat, 7 Nov 2020 21:40:10 -0500 Subject: [PATCH] Added uninitialized for Queue --- src/queue.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/queue.rs b/src/queue.rs index 20f2878..d1c0fce 100644 --- a/src/queue.rs +++ b/src/queue.rs @@ -31,6 +31,14 @@ impl Queue { item_type: PhantomData, }) } + + + pub unsafe fn uninitialized() -> Self { + Self { + queue: core::ptr::null(), + item_type: PhantomData, + } + } /// Send an item to the end of the queue. Wait for the queue to have empty space for it. pub fn send(&self, item: T, max_wait: D) -> Result<(), FreeRtosError> {