Skip to content

Commit 5234ff2

Browse files
committed
G4 and H7 examples are compiling
1 parent a5a28b7 commit 5234ff2

17 files changed

+124
-41
lines changed

Cargo.toml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77

88
stm32f3 = { git = "https://github.com/stm32-rs/stm32-rs-nightlies", optional = true }
9-
#stm32h7 = { git = "", optional = true }
9+
stm32h7 = { git = "https://github.com/stm32-rs/stm32-rs-nightlies", fatures = ["critical-section"], optional = true }
1010
#stm32g4 = { git = "", optional = true }
1111

1212
#stm32f3xx-hal = { version = "0.10.0", optional = true }
@@ -35,7 +35,7 @@ hrtim_v1_1 = []
3535
hrtim_v2 = []
3636

3737
stm32f3 = ["stm32f3/stm32f3x4"]
38-
stm32h7 = []
38+
stm32h7 = ["dep:stm32h7"]
3939
stm32g4 = []
4040

4141
stm32f334x4 = ["stm32f3", "stm32f3xx-hal/stm32f334x4", "hrtim_v1"]
@@ -55,6 +55,16 @@ stm32g474 = ["stm32g4", "stm32g4xx-hal/stm32g474", "hrtim_v2"]
5555
stm32g484 = ["stm32g4", "stm32g4xx-hal/stm32g484", "hrtim_v2"]
5656
defmt = ["dep:defmt", "fugit/defmt"]
5757

58+
# F3
59+
60+
[[example]]
61+
name = "stm32f3"
62+
required-features = ["stm32f3"]
63+
path = "examples/stm32f3/hrtim.rs"
64+
65+
66+
# G4
67+
5868
[[example]]
5969
name = "stm32g4-adc-trigger"
6070
required-features = ["stm32g4"]
@@ -98,4 +108,11 @@ path = "examples/stm32g4/hrtim.rs"
98108
[[example]]
99109
name = "stm32g4-master"
100110
required-features = ["stm32g4"]
101-
path = "examples/stm32g4/master.rs"
111+
path = "examples/stm32g4/master.rs"
112+
113+
# H7
114+
115+
[[example]]
116+
name = "stm32h7"
117+
required-features = ["stm32h7"]
118+
path = "examples/stm32h7/hrtim.rs"

examples/stm32g4/adc-trigger.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn main() -> ! {
8383
..
8484
} = dp
8585
.HRTIM_TIMA
86-
.pwm_advanced((pin_a, pin_b), &mut rcc)
86+
.pwm_advanced((pin_a, pin_b))
8787
.prescaler(prescaler)
8888
.period(period)
8989
.finalize(&mut hr_control);

examples/stm32g4/capture-dma.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn main() -> ! {
8787
..
8888
} = dp
8989
.HRTIM_TIMA
90-
.pwm_advanced(pin_a, &mut rcc)
90+
.pwm_advanced(pin_a)
9191
.prescaler(prescaler)
9292
.period(period)
9393
.finalize(&mut hr_control);

examples/stm32g4/capture.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn main() -> ! {
8282
..
8383
} = dp
8484
.HRTIM_TIMA
85-
.pwm_advanced(pin_a, &mut rcc)
85+
.pwm_advanced(pin_a)
8686
.prescaler(prescaler)
8787
.period(period)
8888
.finalize(&mut hr_control);

examples/stm32g4/eev-comp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fn main() -> ! {
111111
..
112112
} = dp
113113
.HRTIM_TIMA
114-
.pwm_advanced(pin_a, &mut rcc)
114+
.pwm_advanced(pin_a)
115115
.prescaler(prescaler)
116116
.eev_cfg(EevCfgs::default().eev4(EevCfg::default()))
117117
.period(0xFFFF)

examples/stm32g4/eev.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn main() -> ! {
8383
..
8484
} = dp
8585
.HRTIM_TIMA
86-
.pwm_advanced(pin_a, &mut rcc)
86+
.pwm_advanced(pin_a)
8787
.prescaler(prescaler)
8888
.eev_cfg(EevCfgs::default())
8989
.period(0xFFFF)

examples/stm32g4/flt-comp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn main() -> ! {
115115
..
116116
} = dp
117117
.HRTIM_TIMA
118-
.pwm_advanced(pin_a, &mut rcc)
118+
.pwm_advanced(pin_a)
119119
.prescaler(prescaler)
120120
.period(0xFFFF)
121121
.with_fault_source(fault_source5) // Set fault source

examples/stm32g4/flt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn main() -> ! {
8181
..
8282
} = dp
8383
.HRTIM_TIMA
84-
.pwm_advanced(pin_a, &mut rcc)
84+
.pwm_advanced(pin_a)
8585
.prescaler(prescaler)
8686
.period(0xFFFF)
8787
//.with_fault_source(fault_source1)

examples/stm32g4/hrtim.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn main() -> ! {
6969
..
7070
} = dp
7171
.HRTIM_TIMA
72-
.pwm_advanced((pin_a, pin_b), &mut rcc)
72+
.pwm_advanced((pin_a, pin_b))
7373
.prescaler(prescaler)
7474
.period(0xFFFF)
7575
.push_pull_mode(true) // Set push pull mode, out1 and out2 are

examples/stm32g4/master.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn main() -> ! {
7070
..
7171
} = dp
7272
.HRTIM_TIMA
73-
.pwm_advanced((pin_a, pin_b), &mut rcc)
73+
.pwm_advanced((pin_a, pin_b))
7474
.prescaler(prescaler)
7575
.push_pull_mode(true) // Set push pull mode, out1 and out2 are
7676
// alternated every period with one being
@@ -86,7 +86,7 @@ fn main() -> ! {
8686
..
8787
} = dp
8888
.HRTIM_MASTER
89-
.pwm_advanced((), &mut rcc)
89+
.pwm_advanced(())
9090
.prescaler(prescaler)
9191
.preload(MasterPreloadSource::OnMasterRepetitionUpdate)
9292
.period(0xFFFF)

0 commit comments

Comments
 (0)