diff --git a/examples/cfg.rs b/examples/cfg.rs index 16e6e077aa..f4848302a8 100644 --- a/examples/cfg.rs +++ b/examples/cfg.rs @@ -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)] diff --git a/examples/destructure.rs b/examples/destructure.rs index 131c07fbf6..45d7319505 100644 --- a/examples/destructure.rs +++ b/examples/destructure.rs @@ -11,6 +11,7 @@ use panic_semihosting as _; #[rtic::app(device = lm3s6965)] mod app { + #[resources] struct Resources { // Some resources to work with #[init(0)] diff --git a/examples/generics.rs b/examples/generics.rs index 20e9ed7f20..c65e6518ea 100644 --- a/examples/generics.rs +++ b/examples/generics.rs @@ -12,6 +12,7 @@ use rtic::{Exclusive, Mutex}; #[rtic::app(device = lm3s6965)] mod app { + #[resources] struct Resources { #[init(0)] shared: u32, diff --git a/examples/late.rs b/examples/late.rs index 2b99e3dc30..761c68f5be 100644 --- a/examples/late.rs +++ b/examples/late.rs @@ -21,6 +21,7 @@ mod app { spsc::{Consumer, Producer}, }; // Late resources + #[resources] struct Resources { p: Producer<'static, u32, U4>, c: Consumer<'static, u32, U4>, diff --git a/examples/lock.rs b/examples/lock.rs index 61aed21355..6ce61dc6b8 100644 --- a/examples/lock.rs +++ b/examples/lock.rs @@ -11,6 +11,7 @@ use panic_semihosting as _; #[rtic::app(device = lm3s6965)] mod app { + #[resources] struct Resources { #[init(0)] shared: u32, diff --git a/examples/not-send.rs b/examples/not-send.rs index c0582d7628..45f7e4e79f 100644 --- a/examples/not-send.rs +++ b/examples/not-send.rs @@ -19,6 +19,7 @@ pub struct NotSend { mod app { use super::NotSend; + #[resources] struct Resources { #[init(None)] shared: Option, diff --git a/examples/not-sync.rs b/examples/not-sync.rs index 28c76183de..7581642433 100644 --- a/examples/not-sync.rs +++ b/examples/not-sync.rs @@ -19,6 +19,7 @@ mod app { use super::NotSync; use core::marker::PhantomData; + #[resources] struct Resources { #[init(NotSync { _0: PhantomData })] shared: NotSync, diff --git a/examples/only-shared-access.rs b/examples/only-shared-access.rs index 221cc307b1..91d0b7adca 100644 --- a/examples/only-shared-access.rs +++ b/examples/only-shared-access.rs @@ -11,6 +11,7 @@ use panic_semihosting as _; #[rtic::app(device = lm3s6965)] mod app { + #[resources] struct Resources { key: u32, } diff --git a/examples/resource.rs b/examples/resource.rs index 4887b5eff2..4cd0f4cabd 100644 --- a/examples/resource.rs +++ b/examples/resource.rs @@ -11,6 +11,7 @@ use panic_semihosting as _; #[rtic::app(device = lm3s6965)] mod app { + #[resources] struct Resources { // A resource #[init(0)] diff --git a/examples/shared-with-init.rs b/examples/shared-with-init.rs index 9c4499ee90..9f7e26aa06 100644 --- a/examples/shared-with-init.rs +++ b/examples/shared-with-init.rs @@ -16,6 +16,7 @@ pub struct MustBeSend; mod app { use super::MustBeSend; + #[resources] struct Resources { #[init(None)] shared: Option, diff --git a/examples/t-cfg-resources.rs b/examples/t-cfg-resources.rs index 190b32c24a..61eb4c7b10 100644 --- a/examples/t-cfg-resources.rs +++ b/examples/t-cfg-resources.rs @@ -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 { diff --git a/examples/t-cfg.rs b/examples/t-cfg.rs index 7caabe2c69..3deb107ca4 100644 --- a/examples/t-cfg.rs +++ b/examples/t-cfg.rs @@ -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)] diff --git a/examples/t-late-not-send.rs b/examples/t-late-not-send.rs index 587ee73c32..345d9aefa1 100644 --- a/examples/t-late-not-send.rs +++ b/examples/t-late-not-send.rs @@ -15,6 +15,7 @@ pub struct NotSend { mod app { use super::NotSend; + #[resources] struct Resources { x: NotSend, #[init(None)] diff --git a/examples/t-resource.rs b/examples/t-resource.rs index e18a1cd7ac..94b527faeb 100644 --- a/examples/t-resource.rs +++ b/examples/t-resource.rs @@ -9,6 +9,7 @@ use panic_halt as _; #[rtic::app(device = lm3s6965)] mod app { + #[resources] struct Resources { #[init(0)] o1: u32, // init diff --git a/examples/types.rs b/examples/types.rs index 8c612b21ff..cd7e8a2f13 100644 --- a/examples/types.rs +++ b/examples/types.rs @@ -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,