rustfmt on previously edited files

This commit is contained in:
amugniere@gmail.com 2022-07-10 21:08:12 +02:00
parent 53388d4576
commit e4a36e1d98
2 changed files with 22 additions and 26 deletions

View File

@ -74,7 +74,6 @@ impl<'d, T: Pin> Flex<'d, T> {
/// at a specific level, call `set_high`/`set_low` on the pin first.
#[inline]
pub fn set_as_output(&mut self, speed: Speed) {
critical_section::with(|_| unsafe {
let r = self.pin.block();
let n = self.pin.pin() as usize;
@ -106,7 +105,7 @@ impl<'d, T: Pin> Flex<'d, T> {
/// The pin level will be whatever was set before (or low by default). If you want it to begin
/// at a specific level, call `set_high`/`set_low` on the pin first.
#[inline]
pub fn set_as_input_output(&mut self,speed: Speed, pull : Pull) {
pub fn set_as_input_output(&mut self, speed: Speed, pull: Pull) {
critical_section::with(|_| unsafe {
let r = self.pin.block();
let n = self.pin.pin() as usize;
@ -262,7 +261,7 @@ impl From<Speed> for vals::Ospeedr {
/// GPIO input driver.
pub struct Input<'d, T: Pin> {
pub(crate) pin: Flex<'d, T>
pub(crate) pin: Flex<'d, T>,
}
impl<'d, T: Pin> Input<'d, T> {
@ -340,10 +339,9 @@ impl<'d, T: Pin> Output<'d, T> {
}
}
/// GPIO output open-drain driver.
pub struct OutputOpenDrain<'d, T: Pin> {
pub(crate) pin: Flex<'d, T>
pub(crate) pin: Flex<'d, T>,
}
impl<'d, T: Pin> OutputOpenDrain<'d, T> {
@ -925,7 +923,6 @@ mod eh1 {
Ok(self.is_set_low())
}
}
}
#[cfg(feature = "unstable-pac")]

View File

@ -6,7 +6,7 @@
mod example_common;
use defmt::assert;
use embassy::executor::Spawner;
use embassy_stm32::gpio::{Input, Level, Output, OutputOpenDrain, Flex, Pull, Speed};
use embassy_stm32::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull, Speed};
use embassy_stm32::Peripherals;
use example_common::*;
@ -130,7 +130,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
// Test input no pull
{
let mut b = Flex::new(&mut b);
b.set_as_input(Pull::None); // no pull, the status is undefined
b.set_as_input(Pull::None); // no pull, the status is undefined
let mut a = Flex::new(&mut a);
a.set_low();
@ -143,7 +143,6 @@ async fn main(_spawner: Spawner, p: Peripherals) {
assert!(b.is_high());
}
// Test input pulldown
{
let mut b = Flex::new(&mut b);