Skip to content

Commit

Permalink
add enable sync to remaining places
Browse files Browse the repository at this point in the history
  • Loading branch information
fko-kuptec committed Dec 3, 2024
1 parent 8fac96b commit dad7532
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hal/src/peripherals/pwm/d11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ impl $crate::ehal_02::PwmPin for $TYPE {
fn disable(&mut self) {
let count = self.tc.count16();
count.ctrla().modify(|_, w| w.enable().clear_bit());
while count.syncbusy().read().enable().bit_is_set() {}
}

fn enable(&mut self) {
let count = self.tc.count16();
count.ctrla().modify(|_, w| w.enable().set_bit());
while count.syncbusy().read().enable().bit_is_set() {}
}

fn get_duty(&self) -> Self::Duty {
Expand Down Expand Up @@ -228,10 +230,12 @@ impl $crate::ehal_02::Pwm for $TYPE {

fn disable(&mut self, _channel: Self::Channel) {
self.tcc.ctrla().modify(|_, w| w.enable().clear_bit());
while self.tcc.syncbusy().read().enable().bit_is_set() {}
}

fn enable(&mut self, _channel: Self::Channel) {
self.tcc.ctrla().modify(|_, w| w.enable().set_bit());
while self.tcc.syncbusy().read().enable().bit_is_set() {}
}

fn get_period(&self) -> Self::Time {
Expand Down
2 changes: 2 additions & 0 deletions hal/src/peripherals/pwm/d5x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,13 @@ impl<I: PinId> $crate::ehal_02::PwmPin for $TYPE<I> {
fn disable(&mut self) {
let count = self.tc.count16();
count.ctrla().modify(|_, w| w.enable().clear_bit());
while count.syncbusy().read().enable().bit_is_set() {}
}

fn enable(&mut self) {
let count = self.tc.count16();
count.ctrla().modify(|_, w| w.enable().set_bit());
while count.syncbusy().read().enable().bit_is_set() {}
}


Expand Down

0 comments on commit dad7532

Please sign in to comment.