aboutsummaryrefslogtreecommitdiff
path: root/examples/static.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/static.rs')
-rw-r--r--examples/static.rs8
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());
}
}