Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions hal/src/peripherals/timer/d5x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,12 @@ where

// Disable the timer while we reconfigure it
count.ctrla().modify(|_, w| w.enable().clear_bit());
while count.status().read().perbufv().bit_is_set() {}
while count.syncbusy().read().enable().bit_is_set() {}

// Now that we have a clock routed to the peripheral, we
// can ask it to perform a reset.
count.ctrla().write(|w| w.swrst().set_bit());

while count.status().read().perbufv().bit_is_set() {}
// the SVD erroneously marks swrst as write-only, so we
// need to manually read the bit here
while count.ctrla().read().bits() & 1 != 0 {}
while count.syncbusy().read().swrst().bit_is_set() {}

count.ctrlbset().write(|w| {
// Count up when the direction bit is zero
Expand Down Expand Up @@ -184,7 +180,7 @@ impl TimerCounter<$TC>

// Disable the timer while we reconfigure it
count.ctrla().modify(|_, w| w.enable().clear_bit());
while count.status().read().perbufv().bit_is_set() {}
while count.syncbusy().read().enable().bit_is_set() {}
}
Self {
freq: clock.freq(),
Expand Down
Loading