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/one-task.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/one-task.rs') diff --git a/examples/one-task.rs b/examples/one-task.rs index 2e77676..90eb459 100644 --- a/examples/one-task.rs +++ b/examples/one-task.rs @@ -79,9 +79,9 @@ fn idle() -> ! { #[allow(unsafe_code)] fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) { // toggle state - **r.ON = !**r.ON; + *r.ON = !*r.ON; - if **r.ON { + if *r.ON { // set the pin PC13 high // NOTE(unsafe) atomic write to a stateless register unsafe { -- 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/one-task.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/one-task.rs') diff --git a/examples/one-task.rs b/examples/one-task.rs index 90eb459..07def59 100644 --- a/examples/one-task.rs +++ b/examples/one-task.rs @@ -77,7 +77,7 @@ fn idle() -> ! { // `r` is the set of resources this task has access to. `SYS_TICK::Resources` // has one field per resource declared in `app!`. #[allow(unsafe_code)] -fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) { +fn sys_tick(_t: &mut Threshold, mut r: SYS_TICK::Resources) { // toggle state *r.ON = !*r.ON; -- cgit v1.2.3