diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2017-12-09 13:38:41 +0100 |
|---|---|---|
| committer | Jorge Aparicio <jorge@japaric.io> | 2017-12-09 17:15:15 +0100 |
| commit | 219e17268018f397ff3c8a41519c8345aeab7f2f (patch) | |
| tree | 5022a7640b4eae2174fe37f8f9943335f2fb7a0a /examples | |
| parent | 0f5784c2401d4b12004f34345e721598fa21219a (diff) | |
drop the Static wrapper
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/full-syntax.rs | 10 | ||||
| -rw-r--r-- | examples/one-task.rs | 4 | ||||
| -rw-r--r-- | examples/preemption.rs | 4 | ||||
| -rw-r--r-- | examples/two-tasks.rs | 4 |
4 files changed, 11 insertions, 11 deletions
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; } 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 { diff --git a/examples/preemption.rs b/examples/preemption.rs index 98dde8d..07e9362 100644 --- a/examples/preemption.rs +++ b/examples/preemption.rs @@ -47,7 +47,7 @@ fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) { // This task can't be preempted by `tim2` so it has direct access to the // resource data - **r.COUNTER += 1; + *r.COUNTER += 1; // .. } @@ -61,7 +61,7 @@ fn tim2(t: &mut Threshold, mut r: TIM2::Resources) { // lead to undefined behavior. r.COUNTER.claim_mut(t, |counter, _t| { // `claim_mut` creates a critical section - **counter += 1; + *counter += 1; }); // .. 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; // .. } |
