diff options
| author | ragarnoy <[email protected]> | 2025-05-21 12:27:56 +0200 |
|---|---|---|
| committer | ragarnoy <[email protected]> | 2025-05-21 12:27:56 +0200 |
| commit | d5c9d1af26e7bd0ebefafba6ae28b0bd660aa924 (patch) | |
| tree | 018753b0788b41dc29625cc0bf1e1a9d8afbf5cc /examples/stm32h755cm7/src | |
| parent | ddcf13b5260c909d95b72d61131bb1c7e96d2e66 (diff) | |
Remove unnecessary atomic fences from intercore examples
Diffstat (limited to 'examples/stm32h755cm7/src')
| -rw-r--r-- | examples/stm32h755cm7/src/bin/intercore.rs | 5 |
1 files changed, 0 insertions, 5 deletions
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 | } |
