diff options
| author | Grant Miller <[email protected]> | 2022-10-26 17:59:44 -0500 |
|---|---|---|
| committer | Grant Miller <[email protected]> | 2022-10-26 17:59:44 -0500 |
| commit | 4f2dcca34b6e17b07df58ee4f26f852a992e7f8b (patch) | |
| tree | 7edc6e47d965214772e7b96bd18e4ec10531c3a3 | |
| parent | 9c30d565b970330dd0041e790516ab4517dd3b22 (diff) | |
Refactor: Fix v4 `RccPeripheral` bounds
| -rw-r--r-- | embassy-stm32/src/adc/mod.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/adc/v4.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/embassy-stm32/src/adc/mod.rs b/embassy-stm32/src/adc/mod.rs index 70c1025e5..5d90b8b3d 100644 --- a/embassy-stm32/src/adc/mod.rs +++ b/embassy-stm32/src/adc/mod.rs | |||
| @@ -44,9 +44,9 @@ pub(crate) mod sealed { | |||
| 44 | } | 44 | } |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | #[cfg(not(any(adc_f1, adc_v2)))] | 47 | #[cfg(not(any(adc_f1, adc_v2, adc_v4)))] |
| 48 | pub trait Instance: sealed::Instance + 'static {} | 48 | pub trait Instance: sealed::Instance + 'static {} |
| 49 | #[cfg(any(adc_f1, adc_v2))] | 49 | #[cfg(any(adc_f1, adc_v2, adc_v4))] |
| 50 | pub trait Instance: sealed::Instance + crate::rcc::RccPeripheral + 'static {} | 50 | pub trait Instance: sealed::Instance + crate::rcc::RccPeripheral + 'static {} |
| 51 | 51 | ||
| 52 | pub trait AdcPin<T: Instance>: sealed::AdcPin<T> {} | 52 | pub trait AdcPin<T: Instance>: sealed::AdcPin<T> {} |
diff --git a/embassy-stm32/src/adc/v4.rs b/embassy-stm32/src/adc/v4.rs index c83674e61..12f86885c 100644 --- a/embassy-stm32/src/adc/v4.rs +++ b/embassy-stm32/src/adc/v4.rs | |||
| @@ -225,7 +225,7 @@ impl Prescaler { | |||
| 225 | } | 225 | } |
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | impl<'d, T: Instance + crate::rcc::RccPeripheral> Adc<'d, T> { | 228 | impl<'d, T: Instance> Adc<'d, T> { |
| 229 | pub fn new(_peri: impl Peripheral<P = T> + 'd, delay: &mut impl DelayUs<u16>) -> Self { | 229 | pub fn new(_peri: impl Peripheral<P = T> + 'd, delay: &mut impl DelayUs<u16>) -> Self { |
| 230 | embassy_hal_common::into_ref!(_peri); | 230 | embassy_hal_common::into_ref!(_peri); |
| 231 | T::enable(); | 231 | T::enable(); |
