Skip to content

Commit af4e031

Browse files
authored
Merge pull request #655 from stm32-rs/fix-pwm
fix #604
2 parents 27a7b64 + 2f1acd5 commit af4e031

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CHANGELOG.md

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

2626
### Fixed
2727

28+
- Fix #604 pwm output [#655]
2829
- map `$SpiSlave` into `SpiSlave` struct in `spi!` macro [#635]
2930

3031
[#446]: https://github.com/stm32-rs/stm32f4xx-hal/pull/446
@@ -33,6 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3334
[#636]: https://github.com/stm32-rs/stm32f4xx-hal/pull/636
3435
[#640]: https://github.com/stm32-rs/stm32f4xx-hal/pull/640
3536
[#645]: https://github.com/stm32-rs/stm32f4xx-hal/pull/645
37+
[#655]: https://github.com/stm32-rs/stm32f4xx-hal/pull/655
3638

3739
## [v0.16.0] - 2023-05-07
3840

src/timer/pwm.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,17 @@ impl<TIM, Otype, const C: u8> ChannelBuilder<TIM, C, false, Otype>
6464
where
6565
TIM: CPin<C>,
6666
{
67-
pub fn new(_pin: impl Into<TIM::Ch<Otype>>) -> Self {
67+
pub fn new(pin: impl Into<TIM::Ch<Otype>>) -> Self {
68+
let _pin = pin.into();
6869
Self { _tim: PhantomData }
6970
}
7071
}
7172
impl<TIM, Otype, const C: u8, const COMP: bool> ChannelBuilder<TIM, C, COMP, Otype>
7273
where
7374
TIM: CPin<C>,
7475
{
75-
pub fn with(self, _pin: impl Into<TIM::Ch<Otype>>) -> Self {
76+
pub fn with(self, pin: impl Into<TIM::Ch<Otype>>) -> Self {
77+
let _pin = pin.into();
7678
self
7779
}
7880
}
@@ -82,8 +84,9 @@ where
8284
{
8385
pub fn with_complementary(
8486
self,
85-
_pin: impl Into<TIM::ChN<Otype>>,
87+
pin: impl Into<TIM::ChN<Otype>>,
8688
) -> ChannelBuilder<TIM, C, true, Otype> {
89+
let _pin = pin.into();
8790
ChannelBuilder { _tim: PhantomData }
8891
}
8992
}
@@ -530,7 +533,7 @@ where
530533

531534
/// Get raw dead time (DTG) bits
532535
#[inline]
533-
pub fn get_dead_time_bit(&self) -> u8 {
536+
pub fn get_dead_time_bits(&self) -> u8 {
534537
TIM::read_dtg_value()
535538
}
536539

0 commit comments

Comments
 (0)