Skip to content

Commit

Permalink
eh-1.0.0: gpio: move toggle() to StatefulOutputPin
Browse files Browse the repository at this point in the history
  • Loading branch information
richardeoin committed Feb 3, 2024
1 parent 9472c6f commit 9bb33f1
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/gpio/hal_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ use super::{
};

use embedded_hal::digital::{ErrorKind, ErrorType};
use embedded_hal::digital::{
InputPin, OutputPin, StatefulOutputPin, ToggleableOutputPin,
};
use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin};

/// Error type for GPIO
#[derive(Clone, Copy, Debug, PartialEq)]
Expand Down Expand Up @@ -60,11 +58,6 @@ impl<const P: char, const N: u8, MODE> StatefulOutputPin
fn is_set_low(&mut self) -> Result<bool, Self::Error> {
Ok(self._is_set_low())
}
}

impl<const P: char, const N: u8, MODE> ToggleableOutputPin
for Pin<P, N, Output<MODE>>
{
#[inline(always)]
fn toggle(&mut self) -> Result<(), Self::Error> {
self.toggle();
Expand Down Expand Up @@ -117,9 +110,6 @@ impl<MODE> StatefulOutputPin for ErasedPin<Output<MODE>> {
fn is_set_low(&mut self) -> Result<bool, Self::Error> {
Ok(ErasedPin::is_set_low(self))
}
}

impl<MODE> ToggleableOutputPin for ErasedPin<Output<MODE>> {
#[inline(always)]
fn toggle(&mut self) -> Result<(), Self::Error> {
self.toggle();
Expand Down Expand Up @@ -174,11 +164,6 @@ impl<const P: char, MODE> StatefulOutputPin
fn is_set_low(&mut self) -> Result<bool, Self::Error> {
Ok(PartiallyErasedPin::is_set_low(self))
}
}

impl<const P: char, MODE> ToggleableOutputPin
for PartiallyErasedPin<P, Output<MODE>>
{
#[inline(always)]
fn toggle(&mut self) -> Result<(), Self::Error> {
self.toggle();
Expand Down

0 comments on commit 9bb33f1

Please sign in to comment.