Skip to content

Commit c72d569

Browse files
committed
get pin num from AnyPin
1 parent 0ce09e0 commit c72d569

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
@@ -118,6 +118,10 @@ impl AnyPin {
118118
_p: PhantomData,
119119
}
120120
}
121+
/// Gets the pin number.
122+
pub fn get_pin(&self) -> i32 {
123+
self.pin
124+
}
121125
/// Gets a set of the types of pins this pin can be cast to
122126
pub fn types(&self) -> PinTypes {
123127
self.pin_types
@@ -2000,10 +2004,10 @@ macro_rules! define_all_pins {
20002004
$name: $ty::new(),
20012005
)*}
20022006
}
2003-
pub fn into_dynamic(self) -> [(u8, AnyPin); NUM_PINS] {
2007+
pub fn into_dynamic(self) -> [AnyPin; NUM_PINS] {
20042008
[$(
20052009
$(#[cfg($cond)])?
2006-
($id, self.$name.into()),
2010+
self.$name.into(),
20072011
)*]
20082012
}
20092013
}

0 commit comments

Comments
 (0)