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:
@ -215,11 +215,11 @@ impl<'d, Tx, Rx> SubGhz<'d, Tx, Rx> {
|
||||
/// clock.
|
||||
pub fn new(
|
||||
peri: impl Unborrow<Target = SUBGHZSPI> + 'd,
|
||||
sck: impl Unborrow<Target = impl SckPin<SUBGHZSPI>>,
|
||||
mosi: impl Unborrow<Target = impl MosiPin<SUBGHZSPI>>,
|
||||
miso: impl Unborrow<Target = impl MisoPin<SUBGHZSPI>>,
|
||||
txdma: impl Unborrow<Target = Tx>,
|
||||
rxdma: impl Unborrow<Target = Rx>,
|
||||
sck: impl Unborrow<Target = impl SckPin<SUBGHZSPI>> + 'd,
|
||||
mosi: impl Unborrow<Target = impl MosiPin<SUBGHZSPI>> + 'd,
|
||||
miso: impl Unborrow<Target = impl MisoPin<SUBGHZSPI>> + 'd,
|
||||
txdma: impl Unborrow<Target = Tx> + 'd,
|
||||
rxdma: impl Unborrow<Target = Rx> + 'd,
|
||||
) -> Self {
|
||||
Self::pulse_radio_reset();
|
||||
|
||||
|
Reference in New Issue
Block a user