diff options
| author | Grant Miller <[email protected]> | 2022-10-26 17:21:38 -0500 |
|---|---|---|
| committer | Grant Miller <[email protected]> | 2022-10-26 17:35:01 -0500 |
| commit | 6bf24b4d1ab1df57e410de6d6c8f413a2c44d5af (patch) | |
| tree | 59f5a6ed62459af03ccab40bd23a9a236e747471 | |
| parent | 88bbc238b7da95162e4959a62d15c79bfef05149 (diff) | |
Refactor: Remove unused `Common` trait
| -rw-r--r-- | embassy-stm32/src/adc/mod.rs | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/embassy-stm32/src/adc/mod.rs b/embassy-stm32/src/adc/mod.rs index 328470ef6..08989649b 100644 --- a/embassy-stm32/src/adc/mod.rs +++ b/embassy-stm32/src/adc/mod.rs | |||
| @@ -29,11 +29,6 @@ pub(crate) mod sealed { | |||
| 29 | fn common_regs() -> &'static crate::pac::adccommon::AdcCommon; | 29 | fn common_regs() -> &'static crate::pac::adccommon::AdcCommon; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | #[cfg(all(not(adc_f1), not(adc_v1)))] | ||
| 33 | pub trait Common { | ||
| 34 | fn regs() -> &'static crate::pac::adccommon::AdcCommon; | ||
| 35 | } | ||
| 36 | |||
| 37 | pub trait AdcPin<T: Instance> { | 32 | pub trait AdcPin<T: Instance> { |
| 38 | fn channel(&self) -> u8; | 33 | fn channel(&self) -> u8; |
| 39 | } | 34 | } |
| @@ -47,8 +42,7 @@ pub(crate) mod sealed { | |||
| 47 | pub trait Instance: sealed::Instance + 'static {} | 42 | pub trait Instance: sealed::Instance + 'static {} |
| 48 | #[cfg(any(adc_f1, adc_v2))] | 43 | #[cfg(any(adc_f1, adc_v2))] |
| 49 | pub trait Instance: sealed::Instance + crate::rcc::RccPeripheral + 'static {} | 44 | pub trait Instance: sealed::Instance + crate::rcc::RccPeripheral + 'static {} |
| 50 | #[cfg(all(not(adc_f1), not(adc_v1)))] | 45 | |
| 51 | pub trait Common: sealed::Common + 'static {} | ||
| 52 | pub trait AdcPin<T: Instance>: sealed::AdcPin<T> {} | 46 | pub trait AdcPin<T: Instance>: sealed::AdcPin<T> {} |
| 53 | pub trait InternalChannel<T>: sealed::InternalChannel<T> {} | 47 | pub trait InternalChannel<T>: sealed::InternalChannel<T> {} |
| 54 | 48 | ||
| @@ -111,19 +105,6 @@ foreach_peripheral!( | |||
| 111 | }; | 105 | }; |
| 112 | ); | 106 | ); |
| 113 | 107 | ||
| 114 | #[cfg(all(not(adc_f1), not(adc_v1)))] | ||
| 115 | foreach_peripheral!( | ||
| 116 | (adccommon, $inst:ident) => { | ||
| 117 | impl sealed::Common for peripherals::$inst { | ||
| 118 | fn regs() -> &'static crate::pac::adccommon::AdcCommon { | ||
| 119 | &crate::pac::$inst | ||
| 120 | } | ||
| 121 | } | ||
| 122 | |||
| 123 | impl crate::adc::Common for peripherals::$inst {} | ||
| 124 | }; | ||
| 125 | ); | ||
| 126 | |||
| 127 | macro_rules! impl_adc_pin { | 108 | macro_rules! impl_adc_pin { |
| 128 | ($inst:ident, $pin:ident, $ch:expr) => { | 109 | ($inst:ident, $pin:ident, $ch:expr) => { |
| 129 | impl crate::adc::AdcPin<peripherals::$inst> for crate::peripherals::$pin {} | 110 | impl crate::adc::AdcPin<peripherals::$inst> for crate::peripherals::$pin {} |
