From f96b25fdf2d7421cc16830a4ccac4ebb3e69cc5d Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Thu, 15 Oct 2020 18:50:17 +0200 Subject: Updated examples More work --- examples/static.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'examples/static.rs') diff --git a/examples/static.rs b/examples/static.rs index 9c3110c..cd46145 100644 --- a/examples/static.rs +++ b/examples/static.rs @@ -5,20 +5,18 @@ #![no_main] #![no_std] -use cortex_m_semihosting::{debug, hprintln}; -use heapless::{ - consts::*, - i, - spsc::{Consumer, Producer, Queue}, -}; -use lm3s6965::Interrupt; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] mod app { - use crate::U4; - use crate::{Consumer, Producer}; + use cortex_m_semihosting::{debug, hprintln}; + use heapless::{ + consts::*, + i, + spsc::{Consumer, Producer, Queue}, + }; + use lm3s6965::Interrupt; // Late resources #[resources] -- cgit v1.2.3 From f076b33bb91e9cd2cb1f71ba22ebfebab085d3a8 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Wed, 21 Oct 2020 20:20:26 +0200 Subject: Namespace cleanup --- examples/static.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/static.rs') diff --git a/examples/static.rs b/examples/static.rs index cd46145..3b6cd4c 100644 --- a/examples/static.rs +++ b/examples/static.rs @@ -21,7 +21,7 @@ mod app { // Late resources #[resources] struct Resources { - p: Producer<'static, u32, U4>, + ppppp: Producer<'static, u32, U4>, c: Consumer<'static, u32, U4>, } @@ -29,10 +29,10 @@ mod app { fn init(_: init::Context) -> init::LateResources { static mut Q: Queue = Queue(i::Queue::new()); - let (p, c) = Q.split(); + let (ppppp, c) = Q.split(); // Initialization of late resources - init::LateResources { p, c } + init::LateResources { ppppp, c } } #[idle(resources = [c])] @@ -48,10 +48,10 @@ mod app { } } - #[task(binds = UART0, resources = [p])] + #[task(binds = UART0, resources = [ppppp])] fn uart0(c: uart0::Context) { static mut KALLE: u32 = 0; *KALLE += 1; - c.resources.p.enqueue(42).unwrap(); + c.resources.ppppp.enqueue(42).unwrap(); } } -- cgit v1.2.3 From 17e976ab495234f9f53f56e6693850af077cf701 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Wed, 21 Oct 2020 20:33:55 +0200 Subject: Fix UI tests Fix --- examples/static.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/static.rs') diff --git a/examples/static.rs b/examples/static.rs index 3b6cd4c..cd46145 100644 --- a/examples/static.rs +++ b/examples/static.rs @@ -21,7 +21,7 @@ mod app { // Late resources #[resources] struct Resources { - ppppp: Producer<'static, u32, U4>, + p: Producer<'static, u32, U4>, c: Consumer<'static, u32, U4>, } @@ -29,10 +29,10 @@ mod app { fn init(_: init::Context) -> init::LateResources { static mut Q: Queue = Queue(i::Queue::new()); - let (ppppp, c) = Q.split(); + let (p, c) = Q.split(); // Initialization of late resources - init::LateResources { ppppp, c } + init::LateResources { p, c } } #[idle(resources = [c])] @@ -48,10 +48,10 @@ mod app { } } - #[task(binds = UART0, resources = [ppppp])] + #[task(binds = UART0, resources = [p])] fn uart0(c: uart0::Context) { static mut KALLE: u32 = 0; *KALLE += 1; - c.resources.ppppp.enqueue(42).unwrap(); + c.resources.p.enqueue(42).unwrap(); } } -- cgit v1.2.3