aboutsummaryrefslogtreecommitdiff
path: root/examples/static.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2020-10-23 20:52:58 +0000
committerGravatar GitHub <noreply@github.com> 2020-10-23 20:52:58 +0000
commitbbcae14e37c5f4ab5701b2a688bee52bfa7aaa1b (patch)
treec70a80e9bcacb54838f09141bd1d2b27e844760f /examples/static.rs
parentb3aa9e99a975eca637582f31de20fe11ae8f7d64 (diff)
parente8eca4be37a2fe1af25b203ace5e99b31fcc3972 (diff)
downloadrtic-bbcae14e37c5f4ab5701b2a688bee52bfa7aaa1b.tar.gz
rtic-bbcae14e37c5f4ab5701b2a688bee52bfa7aaa1b.tar.zst
rtic-bbcae14e37c5f4ab5701b2a688bee52bfa7aaa1b.zip
Merge #399
399: Now all locks are symmetric r=AfoHT a=korken89 Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
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());
}
}