aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f4
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-07-23 16:14:00 +0200
committerDario Nieuwenhuis <[email protected]>2022-07-23 16:16:29 +0200
commitb5ff7c5d60cd5cba905720b4b8f6cb8c73859ca6 (patch)
tree2b3975074c806fe2c2981b488e8f91be62be3660 /examples/stm32f4
parent042e11960e6018082801d4f268bbe0bdc62edfac (diff)
rename PwmPin::new_chX, update examples.
Diffstat (limited to 'examples/stm32f4')
-rw-r--r--examples/stm32f4/src/bin/pwm.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/stm32f4/src/bin/pwm.rs b/examples/stm32f4/src/bin/pwm.rs
index c99f3cc26..b39bbbe28 100644
--- a/examples/stm32f4/src/bin/pwm.rs
+++ b/examples/stm32f4/src/bin/pwm.rs
@@ -5,7 +5,7 @@
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy::time::{Duration, Timer};
8use embassy_stm32::pwm::simple_pwm::SimplePwm; 8use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm};
9use embassy_stm32::pwm::Channel; 9use embassy_stm32::pwm::Channel;
10use embassy_stm32::time::khz; 10use embassy_stm32::time::khz;
11use embassy_stm32::Peripherals; 11use embassy_stm32::Peripherals;
@@ -15,7 +15,8 @@ use {defmt_rtt as _, panic_probe as _};
15async fn main(_spawner: Spawner, p: Peripherals) { 15async fn main(_spawner: Spawner, p: Peripherals) {
16 info!("Hello World!"); 16 info!("Hello World!");
17 17
18 let mut pwm = SimplePwm::new_1ch(p.TIM1, p.PE9, khz(10)); 18 let ch1 = PwmPin::new_ch1(p.PE9);
19 let mut pwm = SimplePwm::new(p.TIM1, Some(ch1), None, None, None, khz(10));
19 let max = pwm.get_max_duty(); 20 let max = pwm.get_max_duty();
20 pwm.enable(Channel::Ch1); 21 pwm.enable(Channel::Ch1);
21 22