aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpennae <[email protected]>2023-07-21 21:33:53 +0200
committerpennae <[email protected]>2023-08-01 18:31:28 +0200
commit54d31c98fe44533c955c494ea58dd16810367c4f (patch)
treed0baad76532448c182db742577789f9eefc16b1e
parent48eac0b1462726ab292354b50e299c8ebfde85c6 (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.rs21
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
225mod sealed { 225mod sealed {
226 pub trait AdcChannel { 226 pub trait AdcChannel {}
227 fn channel(&mut self) -> u8;
228 }
229} 227}
230 228
231pub trait AdcChannel: sealed::AdcChannel {} 229pub trait AdcChannel: sealed::AdcChannel {}
232pub trait AdcPin: AdcChannel + gpio::Pin {} 230pub trait AdcPin: AdcChannel + gpio::Pin {}
233 231
234macro_rules! impl_pin { 232macro_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
247impl_pin!(PIN_26, 0); 240impl_pin!(PIN_26);
248impl_pin!(PIN_27, 1); 241impl_pin!(PIN_27);
249impl_pin!(PIN_28, 2); 242impl_pin!(PIN_28);
250impl_pin!(PIN_29, 3); 243impl_pin!(PIN_29);