Skip to content

Commit f23d81a

Browse files
committed
get pin num from AnyPin
1 parent 026a255 commit f23d81a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/gpio.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ impl AnyPin {
124124
_p: PhantomData,
125125
}
126126
}
127+
/// Gets the pin number.
128+
pub fn get_pin(&self) -> i32 {
129+
self.pin
130+
}
127131
/// Gets a set of the types of pins this pin can be cast to
128132
pub fn types(&self) -> PinTypes {
129133
self.pin_types
@@ -1661,10 +1665,10 @@ macro_rules! define_all_pins {
16611665
$name: $ty::new(),
16621666
)*}
16631667
}
1664-
pub fn into_dynamic(self) -> [(u8, AnyPin); NUM_PINS] {
1668+
pub fn into_dynamic(self) -> [AnyPin; NUM_PINS] {
16651669
[$(
16661670
$(#[cfg($cond)])?
1667-
($id, self.$name.into()),
1671+
self.$name.into(),
16681672
)*]
16691673
}
16701674
}

0 commit comments

Comments
 (0)