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/full-syntax.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/full-syntax.rs') diff --git a/examples/full-syntax.rs b/examples/full-syntax.rs index a8f79a7..b84077f 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; + *r.ON = !*r.ON; - **r.CO_OWNED += 1; + *r.CO_OWNED += 1; } fn tim2(_t: &mut Threshold, r: TIM2::Resources) { - **r.CO_OWNED += 1; + *r.CO_OWNED += 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/full-syntax.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/full-syntax.rs') diff --git a/examples/full-syntax.rs b/examples/full-syntax.rs index b84077f..5b27412 100644 --- a/examples/full-syntax.rs +++ b/examples/full-syntax.rs @@ -73,12 +73,12 @@ mod main { } } -fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) { +fn sys_tick(_t: &mut Threshold, mut r: SYS_TICK::Resources) { *r.ON = !*r.ON; *r.CO_OWNED += 1; } -fn tim2(_t: &mut Threshold, r: TIM2::Resources) { +fn tim2(_t: &mut Threshold, mut r: TIM2::Resources) { *r.CO_OWNED += 1; } -- cgit v1.2.3