aboutsummaryrefslogtreecommitdiff
path: root/src/tq.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2021-08-16 15:37:39 +0200
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2021-08-16 15:38:31 +0200
commitbc3eb5c54784c32ccfff404dba58a27d5a47f04e (patch)
tree73d4d91075f06a35149ee3b5303bde465d881a64 /src/tq.rs
parent74b396497861ad69dcab0414851ddb8b5c624036 (diff)
downloadrtic-bc3eb5c54784c32ccfff404dba58a27d5a47f04e.tar.gz
rtic-bc3eb5c54784c32ccfff404dba58a27d5a47f04e.tar.zst
rtic-bc3eb5c54784c32ccfff404dba58a27d5a47f04e.zip
Remove linked list impl - use heapless, linked list init now const fn
Diffstat (limited to '')
-rw-r--r--src/tq.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/tq.rs b/src/tq.rs
index cd44abe2..dcaccc9e 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<T, E>(val: Result<T, E>) -> T {
@@ -14,7 +14,9 @@ fn unwrapper<T, E>(val: Result<T, E>) -> T {
}
}
-pub struct TimerQueue<Mono, Task, const N: usize>(pub LinkedList<NotReady<Mono, Task>, Min, N>)
+pub struct TimerQueue<Mono, Task, const N: usize>(
+ pub SortedLinkedList<NotReady<Mono, Task>, 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