File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515### Changed
1616
1717- ` Delay::new() ` is now a ` const ` function (#1999 )
18+ - You can now create an ` AnyPin ` out of an ` ErasedPin ` . (#2072 )
1819
1920### Fixed
2021
Original file line number Diff line number Diff line change @@ -1377,7 +1377,7 @@ macro_rules! gpio {
13771377 /// Pins available on this chip
13781378 pub struct Pins {
13791379 $(
1380- /// GPIO pin number ` $gpionum`.
1380+ # [ doc = concat! ( " GPIO pin number " , $gpionum, "." ) ]
13811381 pub [ < gpio $gpionum >] : GpioPin <$gpionum>,
13821382 ) +
13831383 }
@@ -1394,7 +1394,19 @@ macro_rules! gpio {
13941394 match self {
13951395 $(
13961396 ErasedPin :: [ <Gpio $gpionum >] ( _) => {
1397- $crate:: gpio:: ErasedPin :: [ < Gpio $gpionum >] ( unsafe { GpioPin :: steal( ) } )
1397+ ErasedPin :: [ < Gpio $gpionum >] ( unsafe { GpioPin :: steal( ) } )
1398+ }
1399+ ) +
1400+ }
1401+ }
1402+ }
1403+
1404+ impl $crate:: gpio:: CreateErasedPin for ErasedPin {
1405+ fn erased_pin( & self , _: $crate:: private:: Internal ) -> ErasedPin {
1406+ match self {
1407+ $(
1408+ ErasedPin :: [ <Gpio $gpionum >] ( _) => {
1409+ ErasedPin :: [ < Gpio $gpionum >] ( unsafe { GpioPin :: steal( ) } )
13981410 }
13991411 ) +
14001412 }
You can’t perform that action at this time.
0 commit comments