aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Miller <[email protected]>2022-10-26 17:21:38 -0500
committerGrant Miller <[email protected]>2022-10-26 17:35:01 -0500
commit6bf24b4d1ab1df57e410de6d6c8f413a2c44d5af (patch)
tree59f5a6ed62459af03ccab40bd23a9a236e747471
parent88bbc238b7da95162e4959a62d15c79bfef05149 (diff)
Refactor: Remove unused `Common` trait
-rw-r--r--embassy-stm32/src/adc/mod.rs21
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 {
47pub trait Instance: sealed::Instance + 'static {} 42pub trait Instance: sealed::Instance + 'static {}
48#[cfg(any(adc_f1, adc_v2))] 43#[cfg(any(adc_f1, adc_v2))]
49pub trait Instance: sealed::Instance + crate::rcc::RccPeripheral + 'static {} 44pub trait Instance: sealed::Instance + crate::rcc::RccPeripheral + 'static {}
50#[cfg(all(not(adc_f1), not(adc_v1)))] 45
51pub trait Common: sealed::Common + 'static {}
52pub trait AdcPin<T: Instance>: sealed::AdcPin<T> {} 46pub trait AdcPin<T: Instance>: sealed::AdcPin<T> {}
53pub trait InternalChannel<T>: sealed::InternalChannel<T> {} 47pub 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)))]
115foreach_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
127macro_rules! impl_adc_pin { 108macro_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 {}