diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2019-08-21 10:17:27 +0200 |
|---|---|---|
| committer | Jorge Aparicio <jorge@japaric.io> | 2019-08-21 10:17:27 +0200 |
| commit | 07b2b4d83078d0fd260d5f0812e8d5a34d02b793 (patch) | |
| tree | dba2a8e8316e8cd868ccb7b46a80d63c5f61a224 /examples/late.rs | |
| parent | 0e146f8d1142672725b6abb38478f503a9261c80 (diff) | |
doc up
Diffstat (limited to 'examples/late.rs')
| -rw-r--r-- | examples/late.rs | 8 |
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 } |
