diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-02-10 02:34:59 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-02-10 02:38:10 +0100 |
| commit | 550da471be7b56927b50b5955a6de0916ebe6b1f (patch) | |
| tree | 27b37e111dce9a3a5327c901c1bf139b1c1486d0 /examples/stm32h7/src/bin/dac.rs | |
| parent | 1d265b73b2f46baf60a481c8b8036e50c2b6583f (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.rs | 3 |
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"] |
| 6 | mod example_common; | 6 | mod example_common; |
| 7 | 7 | ||
| 8 | use embassy_stm32::gpio::NoPin; | ||
| 9 | use example_common::*; | 8 | use example_common::*; |
| 10 | 9 | ||
| 11 | use cortex_m_rt::entry; | 10 | use 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 { |
