|
4 | 4 | NOTE: In some cases you need to specify remap you need, especially for TIM2
|
5 | 5 | (see [Alternate function remapping](super::timer)):
|
6 | 6 | */
|
7 |
| - |
8 | 7 | use core::u16;
|
9 | 8 |
|
10 | 9 | use core::marker::PhantomData;
|
11 | 10 |
|
12 | 11 | use crate::hal::{self, Direction};
|
13 |
| -#[cfg(any( |
14 |
| - feature = "stm32f100", |
15 |
| - feature = "stm32f103", |
16 |
| - feature = "stm32f105", |
17 |
| -))] |
| 12 | +#[cfg(any(feature = "stm32f100", feature = "stm32f103", feature = "stm32f105",))] |
18 | 13 | use crate::pac::TIM1;
|
19 |
| -use crate::pac::{TIM2, TIM3}; |
20 | 14 | #[cfg(feature = "medium")]
|
21 | 15 | use crate::pac::TIM4;
|
| 16 | +use crate::pac::{TIM2, TIM3}; |
22 | 17 |
|
23 | 18 | use crate::afio::MAPR;
|
24 | 19 |
|
25 |
| -use crate::timer::{Timer, sealed::Remap}; |
26 | 20 | use crate::pwm_input::Pins;
|
| 21 | +use crate::timer::{sealed::Remap, Timer}; |
27 | 22 |
|
28 | 23 | pub struct Qei<TIM, REMAP, PINS> {
|
29 | 24 | tim: TIM,
|
30 | 25 | pins: PINS,
|
31 | 26 | _remap: PhantomData<REMAP>,
|
32 | 27 | }
|
33 | 28 |
|
34 |
| -#[cfg(any( |
35 |
| - feature = "stm32f100", |
36 |
| - feature = "stm32f103", |
37 |
| - feature = "stm32f105", |
38 |
| -))] |
| 29 | +#[cfg(any(feature = "stm32f100", feature = "stm32f103", feature = "stm32f105",))] |
39 | 30 | impl Timer<TIM1> {
|
40 | 31 | pub fn qei<REMAP, PINS>(self, pins: PINS, mapr: &mut MAPR) -> Qei<TIM1, REMAP, PINS>
|
41 | 32 | where
|
@@ -143,11 +134,7 @@ macro_rules! hal {
|
143 | 134 | }
|
144 | 135 | }
|
145 | 136 |
|
146 |
| -#[cfg(any( |
147 |
| - feature = "stm32f100", |
148 |
| - feature = "stm32f103", |
149 |
| - feature = "stm32f105", |
150 |
| -))] |
| 137 | +#[cfg(any(feature = "stm32f100", feature = "stm32f103", feature = "stm32f105",))] |
151 | 138 | hal! {
|
152 | 139 | TIM1: (_tim1, tim1en, tim1rst),
|
153 | 140 | }
|
|
0 commit comments