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.
This commit is contained in:
@ -6,7 +6,6 @@
|
||||
mod example_common;
|
||||
|
||||
use embassy_stm32::dac::{Channel, Dac, Value};
|
||||
use embassy_stm32::gpio::NoPin;
|
||||
use embassy_stm32::pac;
|
||||
use example_common::*;
|
||||
|
||||
@ -22,7 +21,7 @@ fn main() -> ! {
|
||||
|
||||
let p = embassy_stm32::init(Default::default());
|
||||
|
||||
let mut dac = Dac::new(p.DAC1, p.PA4, NoPin);
|
||||
let mut dac = Dac::new_1ch(p.DAC1, p.PA4);
|
||||
|
||||
loop {
|
||||
for v in 0..=255 {
|
||||
|
Reference in New Issue
Block a user