Skip to content

Commit 9ac5866

Browse files
committed
rustfmt pass
1 parent d8b7a12 commit 9ac5866

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/gpio.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ trait GpioRegExt {
1515
fn in_low(&self, pos: u8) -> bool;
1616
fn out_low(&self, pos: u8) -> bool;
1717
fn set_high(&self, pos: u8);
18-
fn set_low(&self, pos:u8);
18+
fn set_low(&self, pos: u8);
1919
}
2020

2121
pub struct AF0;
@@ -56,7 +56,7 @@ pub struct Output<MODE> {
5656
/// Push pull output (type state)
5757
pub struct PushPull;
5858

59-
use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin, toggleable};
59+
use embedded_hal::digital::{toggleable, InputPin, OutputPin, StatefulOutputPin};
6060

6161
/// Fully erased pin
6262
pub struct Pin<MODE> {
@@ -109,28 +109,28 @@ impl<MODE> InputPin for Pin<Input<MODE>> {
109109

110110
macro_rules! gpio_trait {
111111
($gpiox:ident) => {
112-
impl GpioRegExt for crate::stm32::$gpiox::RegisterBlock {
113-
fn in_low(&self, pos :u8) -> bool {
114-
// NOTE(unsafe) atomic read with no side effects
115-
self.idr.read().bits() & (1 << pos) == 0
116-
}
112+
impl GpioRegExt for crate::stm32::$gpiox::RegisterBlock {
113+
fn in_low(&self, pos: u8) -> bool {
114+
// NOTE(unsafe) atomic read with no side effects
115+
self.idr.read().bits() & (1 << pos) == 0
116+
}
117117

118-
fn out_low(&self, pos: u8) -> bool {
119-
// NOTE(unsafe) atomic read with no side effects
120-
self.odr.read().bits() & (1 << pos) == 0
121-
}
118+
fn out_low(&self, pos: u8) -> bool {
119+
// NOTE(unsafe) atomic read with no side effects
120+
self.odr.read().bits() & (1 << pos) == 0
121+
}
122122

123-
fn set_high(&self, pos: u8) {
124-
// NOTE(unsafe) atomic write to a stateless register
125-
unsafe { self.bsrr.write(|w| w.bits(1 << pos)) }
126-
}
123+
fn set_high(&self, pos: u8) {
124+
// NOTE(unsafe) atomic write to a stateless register
125+
unsafe { self.bsrr.write(|w| w.bits(1 << pos)) }
126+
}
127127

128-
fn set_low(&self, pos: u8) {
129-
// NOTE(unsafe) atomic write to a stateless register
130-
unsafe { self.bsrr.write(|w| w.bits(1 << (pos + 16))) }
131-
}
132-
}
133-
}
128+
fn set_low(&self, pos: u8) {
129+
// NOTE(unsafe) atomic write to a stateless register
130+
unsafe { self.bsrr.write(|w| w.bits(1 << (pos + 16))) }
131+
}
132+
}
133+
};
134134
}
135135

136136
gpio_trait!(gpioa);

0 commit comments

Comments
 (0)