Skip to content

Commit 9f063bb

Browse files
committed
Cargo fmt
1 parent 047d842 commit 9f063bb

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

examples/dynamic_gpio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use nb::block;
99
use cortex_m_rt::entry;
1010
use cortex_m_semihosting::hprintln;
1111
use embedded_hal::digital::v2::{InputPin, OutputPin};
12-
use stm32f1xx_hal::{pac, prelude::*, timer::Timer, gpio::State};
12+
use stm32f1xx_hal::{gpio::State, pac, prelude::*, timer::Timer};
1313

1414
#[entry]
1515
fn main() -> ! {

examples/multi_mode_gpio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use nb::block;
99
use cortex_m_rt::entry;
1010
use cortex_m_semihosting::hprintln;
1111
use embedded_hal::digital::v2::{InputPin, OutputPin};
12-
use stm32f1xx_hal::{pac, prelude::*, timer::Timer, gpio::State};
12+
use stm32f1xx_hal::{gpio::State, pac, prelude::*, timer::Timer};
1313

1414
#[entry]
1515
fn main() -> ! {

src/gpio.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ pub trait ExtiPin {
9696
fn check_interrupt(&mut self) -> bool;
9797
}
9898

99-
10099
pub enum Dynamic {
101100
InputFloating,
102101
InputPullUp,
@@ -110,20 +109,19 @@ pub enum PinModeError {
110109
IncorrectMode,
111110
}
112111

113-
114112
impl Dynamic {
115113
fn is_input(&self) -> bool {
116114
use Dynamic::*;
117115
match self {
118116
InputFloating | InputPullUp | InputPullDown | OutputOpenDrain => true,
119-
OutputPushPull => false
117+
OutputPushPull => false,
120118
}
121119
}
122120
fn is_output(&self) -> bool {
123121
use Dynamic::*;
124122
match self {
125123
InputFloating | InputPullUp | InputPullDown => false,
126-
OutputPushPull | OutputOpenDrain => true
124+
OutputPushPull | OutputOpenDrain => true,
127125
}
128126
}
129127
}
@@ -134,21 +132,20 @@ pub trait PinMode<CR> {
134132
unsafe fn set_mode(cr: &mut CR) -> Self;
135133
}
136134

137-
138135
// These impls are needed because a macro can not brace initialise a ty token
139136
impl<MODE> Input<MODE> {
140137
fn _new() -> Self {
141-
Self {_mode: PhantomData }
138+
Self { _mode: PhantomData }
142139
}
143140
}
144141
impl<MODE> Output<MODE> {
145142
fn _new() -> Self {
146-
Self {_mode: PhantomData }
143+
Self { _mode: PhantomData }
147144
}
148145
}
149146
impl<MODE> Alternate<MODE> {
150147
fn _new() -> Self {
151-
Self {_mode: PhantomData }
148+
Self { _mode: PhantomData }
152149
}
153150
}
154151
impl Debugger {
@@ -1095,7 +1092,6 @@ macro_rules! impl_pxx {
10951092
}
10961093
}
10971094

1098-
10991095
impl_pxx! {
11001096
(gpioa::PAx),
11011097
(gpiob::PBx),
@@ -1104,7 +1100,6 @@ impl_pxx! {
11041100
(gpioe::PEx)
11051101
}
11061102

1107-
11081103
gpio!(GPIOA, gpioa, gpioa, PAx, 0, [
11091104
PA0: (pa0, 0, Input<Floating>, CRL, exticr1),
11101105
PA1: (pa1, 1, Input<Floating>, CRL, exticr1),

0 commit comments

Comments
 (0)