Skip to content

Commit efbb244

Browse files
committed
small monotonic fix
1 parent 0e854f7 commit efbb244

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1414

1515
### Added
1616

17-
- Extended 64-bit monotonic timer
17+
- Extended 64-bit monotonic timer [#640]
1818

1919
### Fixed
2020

@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2323
[#632]: https://github.com/stm32-rs/stm32f4xx-hal/pull/632
2424
[#635]: https://github.com/stm32-rs/stm32f4xx-hal/pull/635
2525
[#636]: https://github.com/stm32-rs/stm32f4xx-hal/pull/636
26+
[#640]: https://github.com/stm32-rs/stm32f4xx-hal/pull/640
2627

2728
## [v0.16.0] - 2023-05-07
2829

src/timer/monotonic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ where
118118

119119
unsafe fn reset(&mut self) {
120120
self.tim.listen_interrupt(Event::C1, true);
121-
TIM::set_cc_value(Channel::C1 as u8, 0);
121+
self.tim.reset_counter();
122122
}
123123

124124
#[inline(always)]
@@ -216,7 +216,7 @@ where
216216
Some(_x) => self.tim.read_count().wrapping_add(TIM::Width::FOR_WRAP), // Will overflow
217217
};
218218

219-
TIM::set_cc_value(0, u32::from(val));
219+
TIM::set_cc_value(Channel::C1 as u8, u32::from(val));
220220
}
221221

222222
fn clear_compare_flag(&mut self) {

0 commit comments

Comments
 (0)