aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/timer.rs
diff options
context:
space:
mode:
authorLiam Murphy <[email protected]>2021-06-29 15:12:42 +1000
committerLiam Murphy <[email protected]>2021-06-29 15:12:42 +1000
commitc0ef40d6e9ee91ef754e90424ecd76fd80c0f125 (patch)
treef0135baf4cccdaa92d4a7972821274a6406a9282 /embassy-nrf/src/timer.rs
parente6d0dba5ca6f986f6d4cd20df5334fe824c40dde (diff)
Correctly unset bits
Diffstat (limited to 'embassy-nrf/src/timer.rs')
-rw-r--r--embassy-nrf/src/timer.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs
index 9c04e1580..a6e91f228 100644
--- a/embassy-nrf/src/timer.rs
+++ b/embassy-nrf/src/timer.rs
@@ -284,7 +284,7 @@ impl<'a, T: Instance> Cc<'a, T> {
284 pub fn unshort_compare_clear(&self) { 284 pub fn unshort_compare_clear(&self) {
285 T::regs() 285 T::regs()
286 .shorts 286 .shorts
287 .modify(|r, w| unsafe { w.bits(r.bits() & (0 << self.n)) }) 287 .modify(|r, w| unsafe { w.bits(r.bits() & !(1 << self.n)) })
288 } 288 }
289 289
290 /// Enable the shortcut between this CC register's COMPARE event and the timer's STOP task. 290 /// Enable the shortcut between this CC register's COMPARE event and the timer's STOP task.
@@ -302,7 +302,7 @@ impl<'a, T: Instance> Cc<'a, T> {
302 pub fn unshort_compare_stop(&self) { 302 pub fn unshort_compare_stop(&self) {
303 T::regs() 303 T::regs()
304 .shorts 304 .shorts
305 .modify(|r, w| unsafe { w.bits(r.bits() & (0 << (8 + self.n))) }) 305 .modify(|r, w| unsafe { w.bits(r.bits() & !(1 << (8 + self.n))) })
306 } 306 }
307 307
308 /// Wait until the timer's counter reaches the value stored in this register. 308 /// Wait until the timer's counter reaches the value stored in this register.