aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Bousquet <[email protected]>2024-05-29 00:33:35 -0400
committerBruno Bousquet <[email protected]>2024-05-29 00:33:35 -0400
commit50039b17a78bbefeca1a3dd6b689ea478079ea6b (patch)
treecb787a6b4627e6f99bc78d15b04d8c8dbecc39c1
parent521332bdd1d682b1d43ab7896b54e280c17b9771 (diff)
fix F103 example
-rw-r--r--examples/stm32f1/.vscode/launch.json2
-rw-r--r--examples/stm32f1/src/bin/pwm_input.rs4
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
4use cortex_m::asm;
4use defmt::*; 5use defmt::*;
5use embassy_executor::Spawner; 6use embassy_executor::Spawner;
6use embassy_stm32::gpio::{Level, Output, Pull, Speed}; 7use 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;