From 5df1f59f47e612d99be42984df99796d8e8590c8 Mon Sep 17 00:00:00 2001 From: Per Lindgren Date: Mon, 26 Oct 2020 15:56:25 +0100 Subject: [PATCH] queue, async_systic2 --- examples/async_systick2.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/async_systick2.rs b/examples/async_systick2.rs index 2aca343a61..3f1245332a 100644 --- a/examples/async_systick2.rs +++ b/examples/async_systick2.rs @@ -109,6 +109,11 @@ mod app { s.syst.disable_interrupt(); s.state = State::Done; s.queue.pop().map(|w| w.waker.wake()); + if let Some(w) = s.queue.peek() { + s.syst.set_reload(w.time); + } else { + s.syst.disable_interrupt(); + } }); } } @@ -176,7 +181,7 @@ impl Task { //use core::cmp::{Ord, Ordering, PartialOrd}; use core::cmp::Ordering; use heapless::binary_heap::{BinaryHeap, Max}; -use heapless::consts::*; +use heapless::consts::U8; pub enum State { Started,