diff options
author | 2017-12-23 10:36:08 +0000 | |
---|---|---|
committer | 2017-12-23 10:36:08 +0000 | |
commit | 8a396c51f2caaeca7ee0f81ef2f3c4f2f73d8df1 (patch) | |
tree | fa6538343f2d524be574285c2bb68057edc11420 /examples/two-tasks.rs | |
parent | 0f5784c2401d4b12004f34345e721598fa21219a (diff) | |
parent | a238fd5dc783f57f8fa61795690e6069b1becd32 (diff) | |
download | rtic-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 '')
-rw-r--r-- | examples/two-tasks.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/two-tasks.rs b/examples/two-tasks.rs index df6e784a..4f567f0c 100644 --- a/examples/two-tasks.rs +++ b/examples/two-tasks.rs @@ -42,18 +42,18 @@ fn idle() -> ! { // As both tasks are running at the same priority one can't preempt the other. // Thus both tasks have direct access to the resource -fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) { +fn sys_tick(_t: &mut Threshold, mut r: SYS_TICK::Resources) { // .. - **r.COUNTER += 1; + *r.COUNTER += 1; // .. } -fn tim2(_t: &mut Threshold, r: TIM2::Resources) { +fn tim2(_t: &mut Threshold, mut r: TIM2::Resources) { // .. - **r.COUNTER += 1; + *r.COUNTER += 1; // .. } |