more smaller improvements
Some checks failed
Rust/va416xx-rs/pipeline/pr-main There was a failure building this commit

This commit is contained in:
2024-09-17 10:14:32 +02:00
parent 3d6a492f79
commit a9185ffb48
2 changed files with 5 additions and 4 deletions

View File

@ -587,7 +587,7 @@ impl<Tim: ValidTim> CountdownTimer<Tim> {
pub fn load(&mut self, timeout: impl Into<Hertz>) {
self.tim.reg().ctrl().modify(|_, w| w.enable().clear_bit());
self.curr_freq = timeout.into();
self.rst_val = self.clock.raw() / self.curr_freq.raw();
self.rst_val = self.clock.raw() / self.curr_freq.raw() - 1;
self.set_reload(self.rst_val);
// Decrementing counter, to set the reset value.
self.set_count(0);
@ -610,7 +610,7 @@ impl<Tim: ValidTim> CountdownTimer<Tim> {
#[inline(always)]
pub fn enable(&mut self) {
self.tim.reg().ctrl().modify(|_, w| w.enable().set_bit());
self.tim.reg().enable().write(|w| unsafe { w.bits(1) });
}
#[inline(always)]