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/one-task.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/one-task.rs')
| -rw-r--r-- | examples/one-task.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/one-task.rs b/examples/one-task.rs index 2e77676..07def59 100644 --- a/examples/one-task.rs +++ b/examples/one-task.rs @@ -77,11 +77,11 @@ 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; + *r.ON = !*r.ON; - if **r.ON { + if *r.ON { // set the pin PC13 high // NOTE(unsafe) atomic write to a stateless register unsafe { |
