From 219e17268018f397ff3c8a41519c8345aeab7f2f Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 9 Dec 2017 13:38:41 +0100 Subject: drop the Static wrapper --- examples/two-tasks.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/two-tasks.rs') diff --git a/examples/two-tasks.rs b/examples/two-tasks.rs index df6e784..e9d31e7 100644 --- a/examples/two-tasks.rs +++ b/examples/two-tasks.rs @@ -45,7 +45,7 @@ fn idle() -> ! { fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) { // .. - **r.COUNTER += 1; + *r.COUNTER += 1; // .. } @@ -53,7 +53,7 @@ fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) { fn tim2(_t: &mut Threshold, r: TIM2::Resources) { // .. - **r.COUNTER += 1; + *r.COUNTER += 1; // .. } -- cgit v1.2.3 From a6dd004113fcbc03ffacacc519d742ee84886c1d Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 9 Dec 2017 14:43:29 +0100 Subject: implement the Resource trait for owned resources this unbreaks the "generics" example --- examples/two-tasks.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/two-tasks.rs') diff --git a/examples/two-tasks.rs b/examples/two-tasks.rs index e9d31e7..4f567f0 100644 --- a/examples/two-tasks.rs +++ b/examples/two-tasks.rs @@ -42,7 +42,7 @@ 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; @@ -50,7 +50,7 @@ fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) { // .. } -fn tim2(_t: &mut Threshold, r: TIM2::Resources) { +fn tim2(_t: &mut Threshold, mut r: TIM2::Resources) { // .. *r.COUNTER += 1; -- cgit v1.2.3