All examples use #[resources] attribute

This commit is contained in:
Henrik Tjäder 2020-06-04 15:24:21 +00:00
parent ec936c3b51
commit 96df0a33b1
15 changed files with 15 additions and 1 deletions

View file

@ -12,6 +12,7 @@ use panic_semihosting as _;
#[rtic::app(device = lm3s6965)]
mod app {
#[resources]
struct Resources {
#[cfg(debug_assertions)] // <- `true` when using the `dev` profile
#[init(0)]

View file

@ -11,6 +11,7 @@ use panic_semihosting as _;
#[rtic::app(device = lm3s6965)]
mod app {
#[resources]
struct Resources {
// Some resources to work with
#[init(0)]

View file

@ -12,6 +12,7 @@ use rtic::{Exclusive, Mutex};
#[rtic::app(device = lm3s6965)]
mod app {
#[resources]
struct Resources {
#[init(0)]
shared: u32,

View file

@ -21,6 +21,7 @@ mod app {
spsc::{Consumer, Producer},
};
// Late resources
#[resources]
struct Resources {
p: Producer<'static, u32, U4>,
c: Consumer<'static, u32, U4>,

View file

@ -11,6 +11,7 @@ use panic_semihosting as _;
#[rtic::app(device = lm3s6965)]
mod app {
#[resources]
struct Resources {
#[init(0)]
shared: u32,

View file

@ -19,6 +19,7 @@ pub struct NotSend {
mod app {
use super::NotSend;
#[resources]
struct Resources {
#[init(None)]
shared: Option<NotSend>,

View file

@ -19,6 +19,7 @@ mod app {
use super::NotSync;
use core::marker::PhantomData;
#[resources]
struct Resources {
#[init(NotSync { _0: PhantomData })]
shared: NotSync,

View file

@ -11,6 +11,7 @@ use panic_semihosting as _;
#[rtic::app(device = lm3s6965)]
mod app {
#[resources]
struct Resources {
key: u32,
}

View file

@ -11,6 +11,7 @@ use panic_semihosting as _;
#[rtic::app(device = lm3s6965)]
mod app {
#[resources]
struct Resources {
// A resource
#[init(0)]

View file

@ -16,6 +16,7 @@ pub struct MustBeSend;
mod app {
use super::MustBeSend;
#[resources]
struct Resources {
#[init(None)]
shared: Option<MustBeSend>,

View file

@ -7,6 +7,7 @@ use panic_halt as _;
#[rtic::app(device = lm3s6965)]
mod app {
#[resources]
struct Resources {
// A resource
#[init(0)]
@ -16,7 +17,6 @@ mod app {
x: u32,
dummy: (), // dummy such that we have at least one late resource
}
#[init]
fn init(_: init::Context) -> init::LateResources {
init::LateResources {

View file

@ -7,6 +7,7 @@ use panic_halt as _;
#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)]
mod app {
#[resources]
struct Resources {
#[cfg(never)]
#[init(0)]

View file

@ -15,6 +15,7 @@ pub struct NotSend {
mod app {
use super::NotSend;
#[resources]
struct Resources {
x: NotSend,
#[init(None)]

View file

@ -9,6 +9,7 @@ use panic_halt as _;
#[rtic::app(device = lm3s6965)]
mod app {
#[resources]
struct Resources {
#[init(0)]
o1: u32, // init

View file

@ -11,6 +11,7 @@ use rtic::cyccnt;
#[rtic::app(device = lm3s6965, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)]
mod app {
#[resources]
struct Resources {
#[init(0)]
shared: u32,