Skip to content

Commit ea1826f

Browse files
authored
Merge pull request #670 from dimpolo/clear_counter_interrupt
reset timer interrupt in Counter::start
2 parents ffd55ce + ea8b2c2 commit ea1826f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313

1414
[#671]: https://github.com/stm32-rs/stm32f4xx-hal/pull/671
1515

16+
### Fixed
17+
- reset timer interrupt in `Counter::start` [#670]
18+
19+
[#670]: https://github.com/stm32-rs/stm32f4xx-hal/pull/670
20+
1621
## [v0.17.0] - 2023-07-11
1722

1823
### Changed

src/timer/counter.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ impl<TIM: Instance> CounterHz<TIM> {
3434
self.tim.disable_counter();
3535
// reset counter
3636
self.tim.reset_counter();
37+
self.tim.clear_interrupt_flag(Event::Update);
3738

3839
let (psc, arr) = compute_arr_presc(timeout.raw(), self.clk.raw());
3940
self.tim.set_prescaler(psc);
@@ -109,6 +110,7 @@ impl<TIM: Instance, const FREQ: u32> Counter<TIM, FREQ> {
109110
self.tim.disable_counter();
110111
// reset counter
111112
self.tim.reset_counter();
113+
self.tim.clear_interrupt_flag(Event::Update);
112114

113115
self.tim.set_auto_reload(timeout.ticks() - 1)?;
114116

0 commit comments

Comments
 (0)