diff options
| author | homunkulus <homunkulus@gmx.com> | 2017-12-23 10:36:08 +0000 |
|---|---|---|
| committer | homunkulus <homunkulus@gmx.com> | 2017-12-23 10:36:08 +0000 |
| commit | 8a396c51f2caaeca7ee0f81ef2f3c4f2f73d8df1 (patch) | |
| tree | fa6538343f2d524be574285c2bb68057edc11420 /examples/full-syntax.rs | |
| parent | 0f5784c2401d4b12004f34345e721598fa21219a (diff) | |
| parent | a238fd5dc783f57f8fa61795690e6069b1becd32 (diff) | |
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.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/full-syntax.rs b/examples/full-syntax.rs index a8f79a7..5b27412 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; } |
