diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2020-10-22 21:36:32 +0200 |
|---|---|---|
| committer | Emil Fresk <emil.fresk@gmail.com> | 2020-10-23 08:38:18 +0200 |
| commit | e8eca4be37a2fe1af25b203ace5e99b31fcc3972 (patch) | |
| tree | c70a80e9bcacb54838f09141bd1d2b27e844760f /examples/late.rs | |
| parent | b3aa9e99a975eca637582f31de20fe11ae8f7d64 (diff) | |
Now all locks are symmetric
Test fixes
Fix test
Fix comment
Diffstat (limited to 'examples/late.rs')
| -rw-r--r-- | examples/late.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/late.rs b/examples/late.rs index d20a69c..d4efaba 100644 --- a/examples/late.rs +++ b/examples/late.rs @@ -35,9 +35,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); @@ -48,7 +48,7 @@ mod app { } #[task(binds = UART0, resources = [p])] - fn uart0(c: uart0::Context) { - c.resources.p.enqueue(42).unwrap(); + fn uart0(mut c: uart0::Context) { + c.resources.p.lock(|p| p.enqueue(42).unwrap()); } } |
