mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-17 21:35:20 +01:00
Namespace cleanup
This commit is contained in:
parent
f96b25fdf2
commit
f076b33bb9
11 changed files with 31 additions and 63 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue