Skip to content

Commit 8240a3a

Browse files
committed
eh-1.0.0: gpio: move toggle() to StatefulOutputPin
1 parent a3332c6 commit 8240a3a

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/gpio/hal_1.rs

+1-16
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ use super::{
44
};
55

66
use embedded_hal::digital::{ErrorKind, ErrorType};
7-
use embedded_hal::digital::{
8-
InputPin, OutputPin, StatefulOutputPin, ToggleableOutputPin,
9-
};
7+
use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin};
108

119
/// Error type for GPIO
1210
#[derive(Clone, Copy, Debug, PartialEq)]
@@ -60,11 +58,6 @@ impl<const P: char, const N: u8, MODE> StatefulOutputPin
6058
fn is_set_low(&mut self) -> Result<bool, Self::Error> {
6159
Ok(self._is_set_low())
6260
}
63-
}
64-
65-
impl<const P: char, const N: u8, MODE> ToggleableOutputPin
66-
for Pin<P, N, Output<MODE>>
67-
{
6861
#[inline(always)]
6962
fn toggle(&mut self) -> Result<(), Self::Error> {
7063
self.toggle();
@@ -117,9 +110,6 @@ impl<MODE> StatefulOutputPin for ErasedPin<Output<MODE>> {
117110
fn is_set_low(&mut self) -> Result<bool, Self::Error> {
118111
Ok(ErasedPin::is_set_low(self))
119112
}
120-
}
121-
122-
impl<MODE> ToggleableOutputPin for ErasedPin<Output<MODE>> {
123113
#[inline(always)]
124114
fn toggle(&mut self) -> Result<(), Self::Error> {
125115
self.toggle();
@@ -174,11 +164,6 @@ impl<const P: char, MODE> StatefulOutputPin
174164
fn is_set_low(&mut self) -> Result<bool, Self::Error> {
175165
Ok(PartiallyErasedPin::is_set_low(self))
176166
}
177-
}
178-
179-
impl<const P: char, MODE> ToggleableOutputPin
180-
for PartiallyErasedPin<P, Output<MODE>>
181-
{
182167
#[inline(always)]
183168
fn toggle(&mut self) -> Result<(), Self::Error> {
184169
self.toggle();

0 commit comments

Comments
 (0)