aboutsummaryrefslogtreecommitdiff
path: root/examples/late.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/late.rs')
-rw-r--r--examples/late.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/late.rs b/examples/late.rs
index 536d71a..2eb12d6 100644
--- a/examples/late.rs
+++ b/examples/late.rs
@@ -8,6 +8,7 @@
use cortex_m_semihosting::{debug, hprintln};
use heapless::{
consts::*,
+ i,
spsc::{Consumer, Producer, Queue},
};
use lm3s6965::Interrupt;
@@ -23,12 +24,9 @@ const APP: () = {
#[init]
fn init(_: init::Context) -> init::LateResources {
- // NOTE: we use `Option` here to work around the lack of
- // a stable `const` constructor
- static mut Q: Option<Queue<u32, U4>> = None;
+ static mut Q: Queue<u32, U4> = Queue(i::Queue::new());
- *Q = Some(Queue::new());
- let (p, c) = Q.as_mut().unwrap().split();
+ let (p, c) = Q.split();
// Initialization of late resources
init::LateResources { p, c }