mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
rp: remove AdcChannel::channel
we're not using it, and actually using it is more trouble than it's worth. remove the false assurance instead.
This commit is contained in:
parent
48eac0b146
commit
54d31c98fe
@ -223,28 +223,21 @@ impl interrupt::typelevel::Handler<interrupt::typelevel::ADC_IRQ_FIFO> for Inter
|
|||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
mod sealed {
|
||||||
pub trait AdcChannel {
|
pub trait AdcChannel {}
|
||||||
fn channel(&mut self) -> u8;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait AdcChannel: sealed::AdcChannel {}
|
pub trait AdcChannel: sealed::AdcChannel {}
|
||||||
pub trait AdcPin: AdcChannel + gpio::Pin {}
|
pub trait AdcPin: AdcChannel + gpio::Pin {}
|
||||||
|
|
||||||
macro_rules! impl_pin {
|
macro_rules! impl_pin {
|
||||||
($pin:ident, $channel:expr) => {
|
($pin:ident) => {
|
||||||
impl sealed::AdcChannel for peripherals::$pin {
|
impl sealed::AdcChannel for peripherals::$pin {}
|
||||||
fn channel(&mut self) -> u8 {
|
|
||||||
$channel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl AdcChannel for peripherals::$pin {}
|
impl AdcChannel for peripherals::$pin {}
|
||||||
impl AdcPin for peripherals::$pin {}
|
impl AdcPin for peripherals::$pin {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_pin!(PIN_26, 0);
|
impl_pin!(PIN_26);
|
||||||
impl_pin!(PIN_27, 1);
|
impl_pin!(PIN_27);
|
||||||
impl_pin!(PIN_28, 2);
|
impl_pin!(PIN_28);
|
||||||
impl_pin!(PIN_29, 3);
|
impl_pin!(PIN_29);
|
||||||
|
Loading…
Reference in New Issue
Block a user