diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32f1/.vscode/launch.json | 2 | ||||
| -rw-r--r-- | examples/stm32f1/src/bin/pwm_input.rs | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/stm32f1/.vscode/launch.json b/examples/stm32f1/.vscode/launch.json index 998508867..71f203614 100644 --- a/examples/stm32f1/.vscode/launch.json +++ b/examples/stm32f1/.vscode/launch.json | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | "executable": "./target/thumbv7m-none-eabi/debug/pwm_input", | 18 | "executable": "./target/thumbv7m-none-eabi/debug/pwm_input", |
| 19 | /* Run `cargo build --example itm` and uncomment this line to run itm example */ | 19 | /* Run `cargo build --example itm` and uncomment this line to run itm example */ |
| 20 | // "executable": "./target/thumbv7em-none-eabihf/debug/examples/itm", | 20 | // "executable": "./target/thumbv7em-none-eabihf/debug/examples/itm", |
| 21 | "device": "STM32F103TB", | 21 | "device": "STM32F103T8", |
| 22 | "configFiles": [ | 22 | "configFiles": [ |
| 23 | "interface/stlink.cfg", | 23 | "interface/stlink.cfg", |
| 24 | "target/stm32f1x.cfg" | 24 | "target/stm32f1x.cfg" |
diff --git a/examples/stm32f1/src/bin/pwm_input.rs b/examples/stm32f1/src/bin/pwm_input.rs index 14978f817..718bf0fcf 100644 --- a/examples/stm32f1/src/bin/pwm_input.rs +++ b/examples/stm32f1/src/bin/pwm_input.rs | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | use cortex_m::asm; | ||
| 4 | use defmt::*; | 5 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| @@ -38,7 +39,8 @@ async fn main(spawner: Spawner) { | |||
| 38 | 39 | ||
| 39 | unwrap!(spawner.spawn(blinky(p.PC13))); | 40 | unwrap!(spawner.spawn(blinky(p.PC13))); |
| 40 | 41 | ||
| 41 | let pwm_input = PwmInput::new(p.TIM2, p.PA0, Pull::None, khz(1000)); | 42 | let mut pwm_input = PwmInput::new(p.TIM2, p.PA0, Pull::None, khz(10)); |
| 43 | pwm_input.enable(); | ||
| 42 | 44 | ||
| 43 | loop { | 45 | loop { |
| 44 | Timer::after_millis(500).await; | 46 | Timer::after_millis(500).await; |
