Skip to content

Commit ebd1be0

Browse files
committed
Enable hrtim feature for devices with support, fix example etc
1 parent 5d0b738 commit ebd1be0

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ usb = ["dep:stm32-usbd"]
8282
stm32g431 = ["stm32g4/stm32g431", "cat2"]
8383
stm32g441 = ["stm32g4/stm32g441", "cat2"]
8484
stm32g473 = ["stm32g4/stm32g473", "cat3", "adc3", "adc4", "adc5"]
85-
stm32g474 = ["stm32g4/stm32g474", "cat3", "adc3", "adc4", "adc5", "stm32-hrtim/stm32g474"]
85+
stm32g474 = ["stm32g4/stm32g474", "cat3", "adc3", "adc4", "adc5", "hrtim", "stm32-hrtim/stm32g474"]
8686
stm32g483 = ["stm32g4/stm32g483", "cat3", "adc3", "adc4", "adc5"]
87-
stm32g484 = ["stm32g4/stm32g484", "cat3", "adc3", "adc4", "adc5", "stm32-hrtim/stm32g484"]
87+
stm32g484 = ["stm32g4/stm32g484", "cat3", "adc3", "adc4", "adc5", "hrtim", "stm32-hrtim/stm32g484"]
8888
stm32g491 = ["stm32g4/stm32g491", "cat4", "adc3"]
8989
stm32g4a1 = ["stm32g4/stm32g4a1", "cat4", "adc3"]
9090

@@ -106,6 +106,7 @@ defmt = [
106106
"embedded-hal/defmt-03",
107107
"embedded-io/defmt-03",
108108
"embedded-test/defmt",
109+
"stm32-hrtim/defmt"
109110
]
110111
cordic = ["dep:fixed"]
111112
adc3 = []

examples/hrtim/hrtim.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#![no_std]
22
#![no_main]
33

4+
#[path ="../utils/mod.rs"]
5+
mod utils;
6+
47
use cortex_m_rt::entry;
58
use panic_probe as _;
69
use stm32_hrtim::{
@@ -87,6 +90,7 @@ fn main() -> ! {
8790

8891
out1.enable();
8992
out2.enable();
93+
timer.start(&mut hr_control.control);
9094

9195
loop {
9296
// Step frequency from 14.6kHz to about 146kHz(half of that when only looking at one pin)

examples/hrtim/master.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ fn main() -> ! {
104104
out1.enable();
105105
out2.enable();
106106

107+
mtimer.start(&mut hr_control.control);
108+
timer.start(&mut hr_control.control);
109+
107110
defmt::info!("Running");
108111

109112
loop {

0 commit comments

Comments
 (0)