diff options
| author | Cameron <[email protected]> | 2023-06-29 17:37:51 +0200 |
|---|---|---|
| committer | Cameron <[email protected]> | 2023-06-29 17:37:51 +0200 |
| commit | e90f47aba31be9d99935c758d87941c7106cbece (patch) | |
| tree | 2bd944e827c780e48a616fbf537cddc8aaf7a837 | |
| parent | 2aa2b843ce6b96aacd72e52fe29b550e7ebc55b3 (diff) | |
Fixed Pointer Updates
| -rw-r--r-- | embassy-nrf/src/ppi/mod.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/embassy-nrf/src/ppi/mod.rs b/embassy-nrf/src/ppi/mod.rs index ba95849e8..0789e2694 100644 --- a/embassy-nrf/src/ppi/mod.rs +++ b/embassy-nrf/src/ppi/mod.rs | |||
| @@ -137,9 +137,9 @@ impl Task { | |||
| 137 | Self(ptr) | 137 | Self(ptr) |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | // Triggers this task. | 140 | /// Triggers this task. |
| 141 | pub unsafe fn trigger(&mut self) { | 141 | pub unsafe fn trigger(&mut self) { |
| 142 | self.0.write(|w| unsafe { w.bits(1) }); | 142 | *self.0.as_ptr() = 1; |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | pub(crate) fn from_reg<T>(reg: &T) -> Self { | 145 | pub(crate) fn from_reg<T>(reg: &T) -> Self { |
| @@ -178,14 +178,14 @@ impl Event { | |||
| 178 | Self(unsafe { NonNull::new_unchecked(reg as *const _ as *mut _) }) | 178 | Self(unsafe { NonNull::new_unchecked(reg as *const _ as *mut _) }) |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | // Describes whether this Event is currently in a triggered state. | 181 | /// Describes whether this Event is currently in a triggered state. |
| 182 | pub unsafe fn is_triggered(&self) -> bool { | 182 | pub unsafe fn is_triggered(&self) -> bool { |
| 183 | self.0.read().bits() == 1 | 183 | *self.0.as_ptr() == 1 |
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | // Clear the current register's triggered state, reverting it to 0. | 186 | /// Clear the current register's triggered state, reverting it to 0. |
| 187 | pub unsafe fn clear(&mut self) { | 187 | pub unsafe fn clear(&mut self) { |
| 188 | self.0.write(|w| unsafe { w.bits(0) }); | 188 | *self.0.as_ptr() = 0; |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | /// Address of publish register for this event. | 191 | /// Address of publish register for this event. |
