diff options
author | 2020-10-22 21:36:32 +0200 | |
---|---|---|
committer | 2020-10-23 08:38:18 +0200 | |
commit | e8eca4be37a2fe1af25b203ace5e99b31fcc3972 (patch) | |
tree | c70a80e9bcacb54838f09141bd1d2b27e844760f /examples/static.rs | |
parent | b3aa9e99a975eca637582f31de20fe11ae8f7d64 (diff) | |
download | rtic-e8eca4be37a2fe1af25b203ace5e99b31fcc3972.tar.gz rtic-e8eca4be37a2fe1af25b203ace5e99b31fcc3972.tar.zst rtic-e8eca4be37a2fe1af25b203ace5e99b31fcc3972.zip |
Now all locks are symmetric
Test fixes
Fix test
Fix comment
Diffstat (limited to 'examples/static.rs')
-rw-r--r-- | examples/static.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/static.rs b/examples/static.rs index cd46145a..7626c712 100644 --- a/examples/static.rs +++ b/examples/static.rs @@ -36,9 +36,9 @@ mod app { } #[idle(resources = [c])] - fn idle(c: idle::Context) -> ! { + fn idle(mut c: idle::Context) -> ! { loop { - if let Some(byte) = c.resources.c.dequeue() { + if let Some(byte) = c.resources.c.lock(|c| c.dequeue()) { hprintln!("received message: {}", byte).unwrap(); debug::exit(debug::EXIT_SUCCESS); @@ -49,9 +49,9 @@ mod app { } #[task(binds = UART0, resources = [p])] - fn uart0(c: uart0::Context) { + fn uart0(mut c: uart0::Context) { static mut KALLE: u32 = 0; *KALLE += 1; - c.resources.p.enqueue(42).unwrap(); + c.resources.p.lock(|p| p.enqueue(42).unwrap()); } } |