Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- `Delay::new()` is now a `const` function (#1999)
- You can now create an `AnyPin` out of an `ErasedPin`. (#2072)

### Fixed

Expand Down
16 changes: 14 additions & 2 deletions esp-hal/src/gpio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ macro_rules! gpio {
/// Pins available on this chip
pub struct Pins {
$(
/// GPIO pin number `$gpionum`.
#[doc = concat!("GPIO pin number ", $gpionum, ".")]
pub [< gpio $gpionum >] : GpioPin<$gpionum>,
)+
}
Expand All @@ -1430,7 +1430,19 @@ macro_rules! gpio {
match self {
$(
ErasedPin::[<Gpio $gpionum >](_) => {
$crate::gpio::ErasedPin::[< Gpio $gpionum >](unsafe { GpioPin::steal() })
ErasedPin::[< Gpio $gpionum >](unsafe { GpioPin::steal() })
}
)+
}
}
}

impl $crate::gpio::CreateErasedPin for ErasedPin {
fn erased_pin(&self, _: $crate::private::Internal) -> ErasedPin {
match self {
$(
ErasedPin::[<Gpio $gpionum >](_) => {
ErasedPin::[< Gpio $gpionum >](unsafe { GpioPin::steal() })
}
)+
}
Expand Down