aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32l4/src
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/stm32l4/src
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/stm32l4/src')
-rw-r--r--examples/stm32l4/src/bin/dac.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/stm32l4/src/bin/dac.rs b/examples/stm32l4/src/bin/dac.rs
index 6cdd6d3ff..201ba473b 100644
--- a/examples/stm32l4/src/bin/dac.rs
+++ b/examples/stm32l4/src/bin/dac.rs
@@ -6,7 +6,6 @@
6mod example_common; 6mod example_common;
7 7
8use embassy_stm32::dac::{Channel, Dac, Value}; 8use embassy_stm32::dac::{Channel, Dac, Value};
9use embassy_stm32::gpio::NoPin;
10use embassy_stm32::pac; 9use embassy_stm32::pac;
11use example_common::*; 10use example_common::*;
12 11
@@ -22,7 +21,7 @@ fn main() -> ! {
22 21
23 let p = embassy_stm32::init(Default::default()); 22 let p = embassy_stm32::init(Default::default());
24 23
25 let mut dac = Dac::new(p.DAC1, p.PA4, NoPin); 24 let mut dac = Dac::new_1ch(p.DAC1, p.PA4);
26 25
27 loop { 26 loop {
28 for v in 0..=255 { 27 for v in 0..=255 {