aboutsummaryrefslogtreecommitdiff
path: root/examples/t-late-not-send.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/t-late-not-send.rs')
-rw-r--r--examples/t-late-not-send.rs18
1 files changed, 11 insertions, 7 deletions
diff --git a/examples/t-late-not-send.rs b/examples/t-late-not-send.rs
index 579f8436..7408a1eb 100644
--- a/examples/t-late-not-send.rs
+++ b/examples/t-late-not-send.rs
@@ -1,4 +1,4 @@
-//! [compile-pass] late resources don't need to be `Send` if they are owned by `idle`
+//! [compile-pass] shared resources don't need to be `Send` if they are owned by `idle`
#![no_main]
#![no_std]
@@ -16,24 +16,28 @@ mod app {
use super::NotSend;
use core::marker::PhantomData;
- #[resources]
- struct Resources {
+ #[shared]
+ struct Shared {
x: NotSend,
- #[init(None)]
y: Option<NotSend>,
}
+ #[local]
+ struct Local {}
+
#[init]
- fn init(_: init::Context) -> (init::LateResources, init::Monotonics) {
+ fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {
(
- init::LateResources {
+ Shared {
x: NotSend { _0: PhantomData },
+ y: None,
},
+ Local {},
init::Monotonics(),
)
}
- #[idle(resources = [x, y])]
+ #[idle(shared = [x, y])]
fn idle(_: idle::Context) -> ! {
loop {
cortex_m::asm::nop();