From bc3eb5c54784c32ccfff404dba58a27d5a47f04e Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Mon, 16 Aug 2021 15:37:39 +0200 Subject: Remove linked list impl - use heapless, linked list init now const fn --- src/tq.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/tq.rs') diff --git a/src/tq.rs b/src/tq.rs index cd44abe..dcaccc9 100644 --- a/src/tq.rs +++ b/src/tq.rs @@ -1,9 +1,9 @@ use crate::{ - linked_list::{LinkedList, Min}, time::{Clock, Instant}, Monotonic, }; use core::cmp::Ordering; +use heapless::sorted_linked_list::{LinkedIndexU16, Min, SortedLinkedList}; #[inline(always)] fn unwrapper(val: Result) -> T { @@ -14,7 +14,9 @@ fn unwrapper(val: Result) -> T { } } -pub struct TimerQueue(pub LinkedList, Min, N>) +pub struct TimerQueue( + pub SortedLinkedList, LinkedIndexU16, Min, N>, +) where Mono: Monotonic, Task: Copy; @@ -24,10 +26,6 @@ where Mono: Monotonic, Task: Copy, { - pub fn new() -> Self { - TimerQueue(LinkedList::new()) - } - /// # Safety /// /// Writing to memory with a transmute in order to enable -- cgit v1.2.3