diff options
| author | xoviat <[email protected]> | 2023-07-22 12:07:02 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-07-22 12:07:02 -0500 |
| commit | 192cdc2f858b8c8ded7fb50338e2045e784951e3 (patch) | |
| tree | 5dd6a9d34d09b4a4fe92c6ef6978bd51eac73941 | |
| parent | 64f8a779ca4453a40f07433c0bb1ebcaeeeba74c (diff) | |
stm32: suppress adc f3
| -rw-r--r-- | embassy-stm32/src/adc/mod.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/embassy-stm32/src/adc/mod.rs b/embassy-stm32/src/adc/mod.rs index 56ecd63ca..94a8538bf 100644 --- a/embassy-stm32/src/adc/mod.rs +++ b/embassy-stm32/src/adc/mod.rs | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | #![macro_use] | 1 | #![macro_use] |
| 2 | 2 | ||
| 3 | #[cfg(not(adc_f3))] | ||
| 3 | #[cfg_attr(adc_f1, path = "f1.rs")] | 4 | #[cfg_attr(adc_f1, path = "f1.rs")] |
| 4 | #[cfg_attr(adc_v1, path = "v1.rs")] | 5 | #[cfg_attr(adc_v1, path = "v1.rs")] |
| 5 | #[cfg_attr(adc_v2, path = "v2.rs")] | 6 | #[cfg_attr(adc_v2, path = "v2.rs")] |
| @@ -7,14 +8,16 @@ | |||
| 7 | #[cfg_attr(adc_v4, path = "v4.rs")] | 8 | #[cfg_attr(adc_v4, path = "v4.rs")] |
| 8 | mod _version; | 9 | mod _version; |
| 9 | 10 | ||
| 10 | #[cfg(not(adc_f1))] | 11 | #[cfg(not(any(adc_f1, adc_f3)))] |
| 11 | mod resolution; | 12 | mod resolution; |
| 12 | mod sample_time; | 13 | mod sample_time; |
| 13 | 14 | ||
| 15 | #[cfg(not(adc_f3))] | ||
| 14 | #[allow(unused)] | 16 | #[allow(unused)] |
| 15 | pub use _version::*; | 17 | pub use _version::*; |
| 16 | #[cfg(not(adc_f1))] | 18 | #[cfg(not(any(adc_f1, adc_f3)))] |
| 17 | pub use resolution::Resolution; | 19 | pub use resolution::Resolution; |
| 20 | #[cfg(not(adc_f3))] | ||
| 18 | pub use sample_time::SampleTime; | 21 | pub use sample_time::SampleTime; |
| 19 | 22 | ||
| 20 | use crate::peripherals; | 23 | use crate::peripherals; |
| @@ -22,13 +25,14 @@ use crate::peripherals; | |||
| 22 | pub struct Adc<'d, T: Instance> { | 25 | pub struct Adc<'d, T: Instance> { |
| 23 | #[allow(unused)] | 26 | #[allow(unused)] |
| 24 | adc: crate::PeripheralRef<'d, T>, | 27 | adc: crate::PeripheralRef<'d, T>, |
| 28 | #[cfg(not(adc_f3))] | ||
| 25 | sample_time: SampleTime, | 29 | sample_time: SampleTime, |
| 26 | } | 30 | } |
| 27 | 31 | ||
| 28 | pub(crate) mod sealed { | 32 | pub(crate) mod sealed { |
| 29 | pub trait Instance { | 33 | pub trait Instance { |
| 30 | fn regs() -> crate::pac::adc::Adc; | 34 | fn regs() -> crate::pac::adc::Adc; |
| 31 | #[cfg(all(not(adc_f1), not(adc_v1)))] | 35 | #[cfg(not(any(adc_f1, adc_v1, adc_f3)))] |
| 32 | fn common_regs() -> crate::pac::adccommon::AdcCommon; | 36 | fn common_regs() -> crate::pac::adccommon::AdcCommon; |
| 33 | } | 37 | } |
| 34 | 38 | ||
| @@ -56,7 +60,7 @@ foreach_peripheral!( | |||
| 56 | fn regs() -> crate::pac::adc::Adc { | 60 | fn regs() -> crate::pac::adc::Adc { |
| 57 | crate::pac::$inst | 61 | crate::pac::$inst |
| 58 | } | 62 | } |
| 59 | #[cfg(all(not(adc_f1), not(adc_v1)))] | 63 | #[cfg(not(any(adc_f1, adc_v1, adc_f3)))] |
| 60 | fn common_regs() -> crate::pac::adccommon::AdcCommon { | 64 | fn common_regs() -> crate::pac::adccommon::AdcCommon { |
| 61 | foreach_peripheral!{ | 65 | foreach_peripheral!{ |
| 62 | (adccommon, $common_inst:ident) => { | 66 | (adccommon, $common_inst:ident) => { |
