From 6bf24b4d1ab1df57e410de6d6c8f413a2c44d5af Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Wed, 26 Oct 2022 17:21:38 -0500 Subject: [PATCH] Refactor: Remove unused `Common` trait --- embassy-stm32/src/adc/mod.rs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/embassy-stm32/src/adc/mod.rs b/embassy-stm32/src/adc/mod.rs index 328470ef..08989649 100644 --- a/embassy-stm32/src/adc/mod.rs +++ b/embassy-stm32/src/adc/mod.rs @@ -29,11 +29,6 @@ pub(crate) mod sealed { fn common_regs() -> &'static crate::pac::adccommon::AdcCommon; } - #[cfg(all(not(adc_f1), not(adc_v1)))] - pub trait Common { - fn regs() -> &'static crate::pac::adccommon::AdcCommon; - } - pub trait AdcPin { fn channel(&self) -> u8; } @@ -47,8 +42,7 @@ pub(crate) mod sealed { pub trait Instance: sealed::Instance + 'static {} #[cfg(any(adc_f1, adc_v2))] pub trait Instance: sealed::Instance + crate::rcc::RccPeripheral + 'static {} -#[cfg(all(not(adc_f1), not(adc_v1)))] -pub trait Common: sealed::Common + 'static {} + pub trait AdcPin: sealed::AdcPin {} pub trait InternalChannel: sealed::InternalChannel {} @@ -111,19 +105,6 @@ foreach_peripheral!( }; ); -#[cfg(all(not(adc_f1), not(adc_v1)))] -foreach_peripheral!( - (adccommon, $inst:ident) => { - impl sealed::Common for peripherals::$inst { - fn regs() -> &'static crate::pac::adccommon::AdcCommon { - &crate::pac::$inst - } - } - - impl crate::adc::Common for peripherals::$inst {} - }; -); - macro_rules! impl_adc_pin { ($inst:ident, $pin:ident, $ch:expr) => { impl crate::adc::AdcPin for crate::peripherals::$pin {}