diff options
author | 2020-10-21 20:20:26 +0200 | |
---|---|---|
committer | 2020-10-21 20:25:13 +0200 | |
commit | f076b33bb91e9cd2cb1f71ba22ebfebab085d3a8 (patch) | |
tree | f5b3ca8705ee1038365a4b8744f650dbceabad01 /examples | |
parent | f96b25fdf2d7421cc16830a4ccac4ebb3e69cc5d (diff) | |
download | rtic-f076b33bb91e9cd2cb1f71ba22ebfebab085d3a8.tar.gz rtic-f076b33bb91e9cd2cb1f71ba22ebfebab085d3a8.tar.zst rtic-f076b33bb91e9cd2cb1f71ba22ebfebab085d3a8.zip |
Namespace cleanup
Diffstat (limited to 'examples')
-rw-r--r-- | examples/generics.rs | 4 | ||||
-rw-r--r-- | examples/shared-with-init.rs | 2 | ||||
-rw-r--r-- | examples/static.rs | 10 | ||||
-rw-r--r-- | examples/task-local-minimal.rs | 3 | ||||
-rw-r--r-- | examples/task-local.rs | 5 |
5 files changed, 13 insertions, 11 deletions
diff --git a/examples/generics.rs b/examples/generics.rs index b13baeb7..16327fb3 100644 --- a/examples/generics.rs +++ b/examples/generics.rs @@ -36,7 +36,7 @@ mod app { hprintln!("UART0(STATE = {})", *STATE).unwrap(); // second argument has type `resources::shared` - advance(STATE, c.resources.shared); + super::advance(STATE, c.resources.shared); rtic::pend(Interrupt::UART1); @@ -53,7 +53,7 @@ mod app { *c.resources.shared += 0; // second argument has type `Exclusive<u32>` - advance(STATE, Exclusive(c.resources.shared)); + super::advance(STATE, Exclusive(c.resources.shared)); } } diff --git a/examples/shared-with-init.rs b/examples/shared-with-init.rs index 049a38bf..ec055886 100644 --- a/examples/shared-with-init.rs +++ b/examples/shared-with-init.rs @@ -12,9 +12,9 @@ pub struct MustBeSend; #[app(device = lm3s6965)] mod app { + use super::MustBeSend; use cortex_m_semihosting::debug; use lm3s6965::Interrupt; - use super::MustBeSend; #[resources] struct Resources { diff --git a/examples/static.rs b/examples/static.rs index cd46145a..3b6cd4cd 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<u32, U4> = 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(); } } diff --git a/examples/task-local-minimal.rs b/examples/task-local-minimal.rs index fd5ac68a..6e25c10d 100644 --- a/examples/task-local-minimal.rs +++ b/examples/task-local-minimal.rs @@ -4,11 +4,12 @@ #![no_main] #![no_std] -use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] mod app { + use cortex_m_semihosting::{debug, hprintln}; + #[resources] struct Resources { // A local (move), late resource diff --git a/examples/task-local.rs b/examples/task-local.rs index 8f0dfc79..462a0d31 100644 --- a/examples/task-local.rs +++ b/examples/task-local.rs @@ -5,12 +5,13 @@ #![no_main] #![no_std] -use cortex_m_semihosting::{debug, hprintln}; -use lm3s6965::Interrupt; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] mod app { + use cortex_m_semihosting::{debug, hprintln}; + use lm3s6965::Interrupt; + #[resources] struct Resources { // An early resource |