Skip to content

Commit 17bf918

Browse files
committed
Run format on touched files
1 parent 8b52514 commit 17bf918

File tree

2 files changed

+7
-26
lines changed

2 files changed

+7
-26
lines changed

examples/qei.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@ use panic_semihosting as _;
88

99
use cortex_m_semihosting::hprintln;
1010

11-
use stm32f1xx_hal::{
12-
prelude::*,
13-
pac,
14-
delay::Delay,
15-
timer::Timer,
16-
};
1711
use cortex_m_rt::entry;
12+
use stm32f1xx_hal::{delay::Delay, pac, prelude::*, timer::Timer};
1813

1914
#[entry]
2015
fn main() -> ! {
@@ -43,8 +38,7 @@ fn main() -> ! {
4338
let c1 = gpiob.pb6;
4439
let c2 = gpiob.pb7;
4540

46-
let qei = Timer::tim4(dp.TIM4, &clocks, &mut rcc.apb1)
47-
.qei((c1, c2), &mut afio.mapr);
41+
let qei = Timer::tim4(dp.TIM4, &clocks, &mut rcc.apb1).qei((c1, c2), &mut afio.mapr);
4842
let mut delay = Delay::new(cp.SYST, clocks);
4943

5044
loop {

src/qei.rs

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,29 @@
44
NOTE: In some cases you need to specify remap you need, especially for TIM2
55
(see [Alternate function remapping](super::timer)):
66
*/
7-
87
use core::u16;
98

109
use core::marker::PhantomData;
1110

1211
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",))]
1813
use crate::pac::TIM1;
19-
use crate::pac::{TIM2, TIM3};
2014
#[cfg(feature = "medium")]
2115
use crate::pac::TIM4;
16+
use crate::pac::{TIM2, TIM3};
2217

2318
use crate::afio::MAPR;
2419

25-
use crate::timer::{Timer, sealed::Remap};
2620
use crate::pwm_input::Pins;
21+
use crate::timer::{sealed::Remap, Timer};
2722

2823
pub struct Qei<TIM, REMAP, PINS> {
2924
tim: TIM,
3025
pins: PINS,
3126
_remap: PhantomData<REMAP>,
3227
}
3328

34-
#[cfg(any(
35-
feature = "stm32f100",
36-
feature = "stm32f103",
37-
feature = "stm32f105",
38-
))]
29+
#[cfg(any(feature = "stm32f100", feature = "stm32f103", feature = "stm32f105",))]
3930
impl Timer<TIM1> {
4031
pub fn qei<REMAP, PINS>(self, pins: PINS, mapr: &mut MAPR) -> Qei<TIM1, REMAP, PINS>
4132
where
@@ -143,11 +134,7 @@ macro_rules! hal {
143134
}
144135
}
145136

146-
#[cfg(any(
147-
feature = "stm32f100",
148-
feature = "stm32f103",
149-
feature = "stm32f105",
150-
))]
137+
#[cfg(any(feature = "stm32f100", feature = "stm32f103", feature = "stm32f105",))]
151138
hal! {
152139
TIM1: (_tim1, tim1en, tim1rst),
153140
}

0 commit comments

Comments
 (0)