aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin/dac.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-02-10 02:34:59 +0100
committerDario Nieuwenhuis <[email protected]>2022-02-10 02:38:10 +0100
commit550da471be7b56927b50b5955a6de0916ebe6b1f (patch)
tree27b37e111dce9a3a5327c901c1bf139b1c1486d0 /examples/stm32h7/src/bin/dac.rs
parent1d265b73b2f46baf60a481c8b8036e50c2b6583f (diff)
stm32: Remove OptionalPin
The idea behind OptionalPin has a few problems: - you need to impl the signal traits for NoPin which is a bit weird https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L413-L416 - you can pass any combination of set/unset pins, which needs checking at runtime https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L130 The replacement is to do multiple `new` constructors for each combination of pins you want to take.
Diffstat (limited to 'examples/stm32h7/src/bin/dac.rs')
-rw-r--r--examples/stm32h7/src/bin/dac.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/stm32h7/src/bin/dac.rs b/examples/stm32h7/src/bin/dac.rs
index 4cd2f2cd1..8353405ad 100644
--- a/examples/stm32h7/src/bin/dac.rs
+++ b/examples/stm32h7/src/bin/dac.rs
@@ -5,7 +5,6 @@
5#[path = "../example_common.rs"] 5#[path = "../example_common.rs"]
6mod example_common; 6mod example_common;
7 7
8use embassy_stm32::gpio::NoPin;
9use example_common::*; 8use example_common::*;
10 9
11use cortex_m_rt::entry; 10use cortex_m_rt::entry;
@@ -17,7 +16,7 @@ fn main() -> ! {
17 16
18 let p = embassy_stm32::init(config()); 17 let p = embassy_stm32::init(config());
19 18
20 let mut dac = Dac::new(p.DAC1, p.PA4, NoPin); 19 let mut dac = Dac::new_1ch(p.DAC1, p.PA4);
21 20
22 loop { 21 loop {
23 for v in 0..=255 { 22 for v in 0..=255 {