diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32h755cm4/src/bin/intercore.rs | 6 | ||||
| -rw-r--r-- | examples/stm32h755cm7/src/bin/intercore.rs | 5 |
2 files changed, 0 insertions, 11 deletions
diff --git a/examples/stm32h755cm4/src/bin/intercore.rs b/examples/stm32h755cm4/src/bin/intercore.rs index 6ebf61cd4..d5e3e7648 100644 --- a/examples/stm32h755cm4/src/bin/intercore.rs +++ b/examples/stm32h755cm4/src/bin/intercore.rs | |||
| @@ -55,9 +55,7 @@ mod shared { | |||
| 55 | } else { | 55 | } else { |
| 56 | current & !(1 << bit) // Clear bit | 56 | current & !(1 << bit) // Clear bit |
| 57 | }; | 57 | }; |
| 58 | |||
| 59 | self.led_states.store(new_value, Ordering::SeqCst); | 58 | self.led_states.store(new_value, Ordering::SeqCst); |
| 60 | core::sync::atomic::fence(Ordering::SeqCst); | ||
| 61 | } | 59 | } |
| 62 | 60 | ||
| 63 | /// Get current LED state | 61 | /// Get current LED state |
| @@ -66,8 +64,6 @@ mod shared { | |||
| 66 | let bit = if is_green { GREEN_LED_BIT } else { YELLOW_LED_BIT }; | 64 | let bit = if is_green { GREEN_LED_BIT } else { YELLOW_LED_BIT }; |
| 67 | 65 | ||
| 68 | let value = self.led_states.load(Ordering::SeqCst); | 66 | let value = self.led_states.load(Ordering::SeqCst); |
| 69 | core::sync::atomic::fence(Ordering::SeqCst); | ||
| 70 | |||
| 71 | (value & (1 << bit)) != 0 | 67 | (value & (1 << bit)) != 0 |
| 72 | } | 68 | } |
| 73 | 69 | ||
| @@ -78,7 +74,6 @@ mod shared { | |||
| 78 | let current = self.counter.load(Ordering::SeqCst); | 74 | let current = self.counter.load(Ordering::SeqCst); |
| 79 | let new_value = current.wrapping_add(1); | 75 | let new_value = current.wrapping_add(1); |
| 80 | self.counter.store(new_value, Ordering::SeqCst); | 76 | self.counter.store(new_value, Ordering::SeqCst); |
| 81 | core::sync::atomic::fence(Ordering::SeqCst); | ||
| 82 | new_value | 77 | new_value |
| 83 | } | 78 | } |
| 84 | 79 | ||
| @@ -86,7 +81,6 @@ mod shared { | |||
| 86 | #[inline(never)] | 81 | #[inline(never)] |
| 87 | pub fn get_counter(&self) -> u32 { | 82 | pub fn get_counter(&self) -> u32 { |
| 88 | let value = self.counter.load(Ordering::SeqCst); | 83 | let value = self.counter.load(Ordering::SeqCst); |
| 89 | core::sync::atomic::fence(Ordering::SeqCst); | ||
| 90 | value | 84 | value |
| 91 | } | 85 | } |
| 92 | } | 86 | } |
diff --git a/examples/stm32h755cm7/src/bin/intercore.rs b/examples/stm32h755cm7/src/bin/intercore.rs index 530e782ab..a4e1b5ff4 100644 --- a/examples/stm32h755cm7/src/bin/intercore.rs +++ b/examples/stm32h755cm7/src/bin/intercore.rs | |||
| @@ -67,7 +67,6 @@ mod shared { | |||
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | self.led_states.store(new_value, Ordering::SeqCst); | 69 | self.led_states.store(new_value, Ordering::SeqCst); |
| 70 | core::sync::atomic::compiler_fence(Ordering::SeqCst); | ||
| 71 | } | 70 | } |
| 72 | 71 | ||
| 73 | /// Get current LED state | 72 | /// Get current LED state |
| @@ -77,8 +76,6 @@ mod shared { | |||
| 77 | let bit = if is_green { GREEN_LED_BIT } else { YELLOW_LED_BIT }; | 76 | let bit = if is_green { GREEN_LED_BIT } else { YELLOW_LED_BIT }; |
| 78 | 77 | ||
| 79 | let value = self.led_states.load(Ordering::SeqCst); | 78 | let value = self.led_states.load(Ordering::SeqCst); |
| 80 | core::sync::atomic::compiler_fence(Ordering::SeqCst); | ||
| 81 | |||
| 82 | (value & (1 << bit)) != 0 | 79 | (value & (1 << bit)) != 0 |
| 83 | } | 80 | } |
| 84 | 81 | ||
| @@ -88,7 +85,6 @@ mod shared { | |||
| 88 | let current = self.counter.load(Ordering::SeqCst); | 85 | let current = self.counter.load(Ordering::SeqCst); |
| 89 | let new_value = current.wrapping_add(1); | 86 | let new_value = current.wrapping_add(1); |
| 90 | self.counter.store(new_value, Ordering::SeqCst); | 87 | self.counter.store(new_value, Ordering::SeqCst); |
| 91 | core::sync::atomic::compiler_fence(Ordering::SeqCst); | ||
| 92 | new_value | 88 | new_value |
| 93 | } | 89 | } |
| 94 | 90 | ||
| @@ -97,7 +93,6 @@ mod shared { | |||
| 97 | #[allow(dead_code)] | 93 | #[allow(dead_code)] |
| 98 | pub fn get_counter(&self) -> u32 { | 94 | pub fn get_counter(&self) -> u32 { |
| 99 | let value = self.counter.load(Ordering::SeqCst); | 95 | let value = self.counter.load(Ordering::SeqCst); |
| 100 | core::sync::atomic::compiler_fence(Ordering::SeqCst); | ||
| 101 | value | 96 | value |
| 102 | } | 97 | } |
| 103 | } | 98 | } |
