aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7
diff options
context:
space:
mode:
authorGrant Miller <[email protected]>2024-09-06 15:08:58 -0500
committerGrant Miller <[email protected]>2024-09-06 15:08:58 -0500
commitb8beaba6df08c4455f55780a6e13191d95ad9eec (patch)
tree0f7ddde7691c4d2141e307fbbd44f8ddcb77c107 /examples/stm32h7
parentd24c47a3ff4a82786b67f06d876bafb1bdabc163 (diff)
last oops I promise
Diffstat (limited to 'examples/stm32h7')
-rw-r--r--examples/stm32h7/src/bin/pwm.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/stm32h7/src/bin/pwm.rs b/examples/stm32h7/src/bin/pwm.rs
index 1d0b89e97..a1c53fc3f 100644
--- a/examples/stm32h7/src/bin/pwm.rs
+++ b/examples/stm32h7/src/bin/pwm.rs
@@ -6,7 +6,6 @@ use embassy_executor::Spawner;
6use embassy_stm32::gpio::OutputType; 6use embassy_stm32::gpio::OutputType;
7use embassy_stm32::time::khz; 7use embassy_stm32::time::khz;
8use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; 8use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm};
9use embassy_stm32::timer::Channel;
10use embassy_stm32::Config; 9use embassy_stm32::Config;
11use embassy_time::Timer; 10use embassy_time::Timer;
12use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
@@ -39,7 +38,7 @@ async fn main(_spawner: Spawner) {
39 38
40 let ch1_pin = PwmPin::new_ch1(p.PA6, OutputType::PushPull); 39 let ch1_pin = PwmPin::new_ch1(p.PA6, OutputType::PushPull);
41 let mut pwm = SimplePwm::new(p.TIM3, Some(ch1_pin), None, None, None, khz(10), Default::default()); 40 let mut pwm = SimplePwm::new(p.TIM3, Some(ch1_pin), None, None, None, khz(10), Default::default());
42 let mut ch1 = pwm.ch1; 41 let mut ch1 = pwm.ch1();
43 ch1.enable(); 42 ch1.enable();
44 43
45 info!("PWM initialized"); 44 info!("PWM initialized");
@@ -50,7 +49,7 @@ async fn main(_spawner: Spawner) {
50 Timer::after_millis(300).await; 49 Timer::after_millis(300).await;
51 ch1.set_duty_cycle_fraction(1, 4); 50 ch1.set_duty_cycle_fraction(1, 4);
52 Timer::after_millis(300).await; 51 Timer::after_millis(300).await;
53 ch1.set_dutycycle_fraction(1, 2); 52 ch1.set_duty_cycle_fraction(1, 2);
54 Timer::after_millis(300).await; 53 Timer::after_millis(300).await;
55 ch1.set_duty_cycle(ch1.max_duty_cycle() - 1); 54 ch1.set_duty_cycle(ch1.max_duty_cycle() - 1);
56 Timer::after_millis(300).await; 55 Timer::after_millis(300).await;