Skip to content

Commit

Permalink
Merge pull request #655 from stm32-rs/fix-pwm
Browse files Browse the repository at this point in the history
fix #604
  • Loading branch information
burrbull authored Jun 24, 2023
2 parents 27a7b64 + 2f1acd5 commit af4e031
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

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

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

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

Expand Down
11 changes: 7 additions & 4 deletions src/timer/pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@ impl<TIM, Otype, const C: u8> ChannelBuilder<TIM, C, false, Otype>
where
TIM: CPin<C>,
{
pub fn new(_pin: impl Into<TIM::Ch<Otype>>) -> Self {
pub fn new(pin: impl Into<TIM::Ch<Otype>>) -> Self {
let _pin = pin.into();
Self { _tim: PhantomData }
}
}
impl<TIM, Otype, const C: u8, const COMP: bool> ChannelBuilder<TIM, C, COMP, Otype>
where
TIM: CPin<C>,
{
pub fn with(self, _pin: impl Into<TIM::Ch<Otype>>) -> Self {
pub fn with(self, pin: impl Into<TIM::Ch<Otype>>) -> Self {
let _pin = pin.into();
self
}
}
Expand All @@ -82,8 +84,9 @@ where
{
pub fn with_complementary(
self,
_pin: impl Into<TIM::ChN<Otype>>,
pin: impl Into<TIM::ChN<Otype>>,
) -> ChannelBuilder<TIM, C, true, Otype> {
let _pin = pin.into();
ChannelBuilder { _tim: PhantomData }
}
}
Expand Down Expand Up @@ -530,7 +533,7 @@ where

/// Get raw dead time (DTG) bits
#[inline]
pub fn get_dead_time_bit(&self) -> u8 {
pub fn get_dead_time_bits(&self) -> u8 {
TIM::read_dtg_value()
}

Expand Down

0 comments on commit af4e031

Please sign in to comment.