rtic/ui/lockall_move_out_field.rs
2021-11-03 10:07:10 +01:00

24 lines
453 B
Rust

#![no_main]
#[rtic::app(device = lm3s6965, dispatchers = [GPIOA])]
mod app {
#[shared]
struct Shared {
a: u32,
}
#[local]
struct Local {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {
foo::spawn().unwrap();
(Shared { a: 0 }, Local {}, init::Monotonics())
}
#[task(shared = [a])]
fn foo(mut c: foo::Context) {
let _ = c.shared.lock(|s| s.a);
}
}