diff options
| author | pennae <[email protected]> | 2023-07-21 21:33:53 +0200 |
|---|---|---|
| committer | pennae <[email protected]> | 2023-08-01 18:31:28 +0200 |
| commit | 54d31c98fe44533c955c494ea58dd16810367c4f (patch) | |
| tree | d0baad76532448c182db742577789f9eefc16b1e | |
| parent | 48eac0b1462726ab292354b50e299c8ebfde85c6 (diff) | |
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.
| -rw-r--r-- | embassy-rp/src/adc.rs | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/embassy-rp/src/adc.rs b/embassy-rp/src/adc.rs index e0c2910b8..38b323ec9 100644 --- a/embassy-rp/src/adc.rs +++ b/embassy-rp/src/adc.rs | |||
| @@ -223,28 +223,21 @@ impl interrupt::typelevel::Handler<interrupt::typelevel::ADC_IRQ_FIFO> for Inter | |||
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | mod sealed { | 225 | mod sealed { |
| 226 | pub trait AdcChannel { | 226 | pub trait AdcChannel {} |
| 227 | fn channel(&mut self) -> u8; | ||
| 228 | } | ||
| 229 | } | 227 | } |
| 230 | 228 | ||
| 231 | pub trait AdcChannel: sealed::AdcChannel {} | 229 | pub trait AdcChannel: sealed::AdcChannel {} |
| 232 | pub trait AdcPin: AdcChannel + gpio::Pin {} | 230 | pub trait AdcPin: AdcChannel + gpio::Pin {} |
| 233 | 231 | ||
| 234 | macro_rules! impl_pin { | 232 | macro_rules! impl_pin { |
| 235 | ($pin:ident, $channel:expr) => { | 233 | ($pin:ident) => { |
| 236 | impl sealed::AdcChannel for peripherals::$pin { | 234 | impl sealed::AdcChannel for peripherals::$pin {} |
| 237 | fn channel(&mut self) -> u8 { | ||
| 238 | $channel | ||
| 239 | } | ||
| 240 | } | ||
| 241 | |||
| 242 | impl AdcChannel for peripherals::$pin {} | 235 | impl AdcChannel for peripherals::$pin {} |
| 243 | impl AdcPin for peripherals::$pin {} | 236 | impl AdcPin for peripherals::$pin {} |
| 244 | }; | 237 | }; |
| 245 | } | 238 | } |
| 246 | 239 | ||
| 247 | impl_pin!(PIN_26, 0); | 240 | impl_pin!(PIN_26); |
| 248 | impl_pin!(PIN_27, 1); | 241 | impl_pin!(PIN_27); |
| 249 | impl_pin!(PIN_28, 2); | 242 | impl_pin!(PIN_28); |
| 250 | impl_pin!(PIN_29, 3); | 243 | impl_pin!(PIN_29); |
