mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-29 06:54:33 +01:00
All examples use #[resources] attribute
This commit is contained in:
parent
ec936c3b51
commit
96df0a33b1
15 changed files with 15 additions and 1 deletions
|
@ -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)]
|
||||
|
|
|
@ -11,6 +11,7 @@ use panic_semihosting as _;
|
|||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod app {
|
||||
#[resources]
|
||||
struct Resources {
|
||||
// Some resources to work with
|
||||
#[init(0)]
|
||||
|
|
|
@ -12,6 +12,7 @@ use rtic::{Exclusive, Mutex};
|
|||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod app {
|
||||
#[resources]
|
||||
struct Resources {
|
||||
#[init(0)]
|
||||
shared: u32,
|
||||
|
|
|
@ -21,6 +21,7 @@ mod app {
|
|||
spsc::{Consumer, Producer},
|
||||
};
|
||||
// Late resources
|
||||
#[resources]
|
||||
struct Resources {
|
||||
p: Producer<'static, u32, U4>,
|
||||
c: Consumer<'static, u32, U4>,
|
||||
|
|
|
@ -11,6 +11,7 @@ use panic_semihosting as _;
|
|||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod app {
|
||||
#[resources]
|
||||
struct Resources {
|
||||
#[init(0)]
|
||||
shared: u32,
|
||||
|
|
|
@ -19,6 +19,7 @@ pub struct NotSend {
|
|||
mod app {
|
||||
use super::NotSend;
|
||||
|
||||
#[resources]
|
||||
struct Resources {
|
||||
#[init(None)]
|
||||
shared: Option<NotSend>,
|
||||
|
|
|
@ -19,6 +19,7 @@ mod app {
|
|||
use super::NotSync;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
#[resources]
|
||||
struct Resources {
|
||||
#[init(NotSync { _0: PhantomData })]
|
||||
shared: NotSync,
|
||||
|
|
|
@ -11,6 +11,7 @@ use panic_semihosting as _;
|
|||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod app {
|
||||
#[resources]
|
||||
struct Resources {
|
||||
key: u32,
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ use panic_semihosting as _;
|
|||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod app {
|
||||
#[resources]
|
||||
struct Resources {
|
||||
// A resource
|
||||
#[init(0)]
|
||||
|
|
|
@ -16,6 +16,7 @@ pub struct MustBeSend;
|
|||
mod app {
|
||||
use super::MustBeSend;
|
||||
|
||||
#[resources]
|
||||
struct Resources {
|
||||
#[init(None)]
|
||||
shared: Option<MustBeSend>,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -15,6 +15,7 @@ pub struct NotSend {
|
|||
mod app {
|
||||
use super::NotSend;
|
||||
|
||||
#[resources]
|
||||
struct Resources {
|
||||
x: NotSend,
|
||||
#[init(None)]
|
||||
|
|
|
@ -9,6 +9,7 @@ use panic_halt as _;
|
|||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod app {
|
||||
#[resources]
|
||||
struct Resources {
|
||||
#[init(0)]
|
||||
o1: u32, // init
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue