rtic/ui/lockall_borrow_shared_a.rs

25 lines
474 B
Rust
Raw Permalink Normal View History

2021-10-26 19:35:41 +02:00
#![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) {
(Shared { a: 0 }, Local {}, init::Monotonics())
}
#[task(shared = [a])]
fn foo(mut c: foo::Context) {
c.shared.lock(|_| {
c.shared.a.lock(|_| {}); // borrow error
});
}
}