We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 568d37f + a85eb5a commit d0c0aa3Copy full SHA for d0c0aa3
CHANGELOG.md
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
9
10
### Changed
11
12
+- `PwmHz::get_period`: fix computation of return value, prevent division by zero
13
- apply #[inline] attribute to bitbanding functions [#517]
14
- update `stm32f4` to 0.15.1 [#481]
15
- use `stm32_i2s_v12x` version 0.3, reexport it, and implements requirement for it [#490]
src/timer/pwm.rs
@@ -301,7 +301,7 @@ where
301
let arr = TIM::read_auto_reload();
302
303
// Length in ms of an internal clock pulse
304
- clk / (psc * arr)
+ clk / ((psc + 1) * (arr + 1))
305
}
306
307
pub fn set_period(&mut self, period: Hertz) {
0 commit comments