diff options
author | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2022-07-23 16:14:00 +0200 |
---|---|---|
committer | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2022-07-23 16:16:29 +0200 |
commit | b5ff7c5d60cd5cba905720b4b8f6cb8c73859ca6 (patch) | |
tree | 2b3975074c806fe2c2981b488e8f91be62be3660 /examples/stm32g4/src | |
parent | 042e11960e6018082801d4f268bbe0bdc62edfac (diff) | |
download | embassy-b5ff7c5d60cd5cba905720b4b8f6cb8c73859ca6.zip |
rename PwmPin::new_chX, update examples.
Diffstat (limited to 'examples/stm32g4/src')
-rw-r--r-- | examples/stm32g4/src/bin/pwm.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/stm32g4/src/bin/pwm.rs b/examples/stm32g4/src/bin/pwm.rs index 579e289b..dc4e164a 100644 --- a/examples/stm32g4/src/bin/pwm.rs +++ b/examples/stm32g4/src/bin/pwm.rs @@ -5,7 +5,7 @@ use defmt::*; use embassy::executor::Spawner; use embassy::time::{Duration, Timer}; -use embassy_stm32::pwm::simple_pwm::SimplePwm; +use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; use embassy_stm32::pwm::Channel; use embassy_stm32::time::khz; use embassy_stm32::Peripherals; @@ -15,7 +15,8 @@ use {defmt_rtt as _, panic_probe as _}; async fn main(_spawner: Spawner, p: Peripherals) { info!("Hello World!"); - let mut pwm = SimplePwm::new_1ch(p.TIM2, p.PA5, khz(10)); + let ch1 = PwmPin::new_ch1(p.PA5); + let mut pwm = SimplePwm::new(p.TIM2, Some(ch1), None, None, None, khz(10)); let max = pwm.get_max_duty(); pwm.enable(Channel::Ch1); |