aboutsummaryrefslogtreecommitdiff
path: root/examples/full-syntax.rs
diff options
context:
space:
mode:
authorGravatar homunkulus <homunkulus@gmx.com> 2017-12-23 10:36:08 +0000
committerGravatar homunkulus <homunkulus@gmx.com> 2017-12-23 10:36:08 +0000
commit8a396c51f2caaeca7ee0f81ef2f3c4f2f73d8df1 (patch)
treefa6538343f2d524be574285c2bb68057edc11420 /examples/full-syntax.rs
parent0f5784c2401d4b12004f34345e721598fa21219a (diff)
parenta238fd5dc783f57f8fa61795690e6069b1becd32 (diff)
downloadrtic-8a396c51f2caaeca7ee0f81ef2f3c4f2f73d8df1.tar.gz
rtic-8a396c51f2caaeca7ee0f81ef2f3c4f2f73d8df1.tar.zst
rtic-8a396c51f2caaeca7ee0f81ef2f3c4f2f73d8df1.zip
Auto merge of #58 - japaric:init-resources, r=japaric
safe `&'static mut` references via init.resources see RFC #59 for details
Diffstat (limited to 'examples/full-syntax.rs')
-rw-r--r--examples/full-syntax.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/full-syntax.rs b/examples/full-syntax.rs
index a8f79a72..5b274122 100644
--- a/examples/full-syntax.rs
+++ b/examples/full-syntax.rs
@@ -63,22 +63,22 @@ mod main {
*r.OWNED != *r.OWNED;
if *r.OWNED {
- if r.SHARED.claim(t, |shared, _| **shared) {
+ if r.SHARED.claim(t, |shared, _| *shared) {
rtfm::wfi();
}
} else {
- r.SHARED.claim_mut(t, |shared, _| **shared = !**shared);
+ r.SHARED.claim_mut(t, |shared, _| *shared = !*shared);
}
}
}
}
-fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) {
- **r.ON = !**r.ON;
+fn sys_tick(_t: &mut Threshold, mut r: SYS_TICK::Resources) {
+ *r.ON = !*r.ON;
- **r.CO_OWNED += 1;
+ *r.CO_OWNED += 1;
}
-fn tim2(_t: &mut Threshold, r: TIM2::Resources) {
- **r.CO_OWNED += 1;
+fn tim2(_t: &mut Threshold, mut r: TIM2::Resources) {
+ *r.CO_OWNED += 1;
}