Correctly unset bits

This commit is contained in:
Liam Murphy 2021-06-29 15:12:42 +10:00
parent e6d0dba5ca
commit c0ef40d6e9

View file

@ -284,7 +284,7 @@ impl<'a, T: Instance> Cc<'a, T> {
pub fn unshort_compare_clear(&self) {
T::regs()
.shorts
.modify(|r, w| unsafe { w.bits(r.bits() & (0 << self.n)) })
.modify(|r, w| unsafe { w.bits(r.bits() & !(1 << self.n)) })
}
/// 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> {
pub fn unshort_compare_stop(&self) {
T::regs()
.shorts
.modify(|r, w| unsafe { w.bits(r.bits() & (0 << (8 + self.n))) })
.modify(|r, w| unsafe { w.bits(r.bits() & !(1 << (8 + self.n))) })
}
/// Wait until the timer's counter reaches the value stored in this register.