Skip to content

Commit 74ce5e0

Browse files
committed
enum from output
1 parent 557b7f2 commit 74ce5e0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
- Split USART and UART implementations
1111
- Add `lapce` editor settings [#601]
12-
- Use `enum`s for alternate peripheral pins [#594]
12+
- Use `enum`s for alternate peripheral pins [#594] [#610]
1313
- Added missing U(S)ART DMA traits for HAL serial types [#593]
1414
- Improve SPI::new* docs [#587]
1515
- Add advanced timer dead time insertion example [#585]
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2525
[#599]: https://github.com/stm32-rs/stm32f4xx-hal/pull/599
2626
[#601]: https://github.com/stm32-rs/stm32f4xx-hal/pull/601
2727
[#603]: https://github.com/stm32-rs/stm32f4xx-hal/pull/603
28+
[#610]: https://github.com/stm32-rs/stm32f4xx-hal/pull/610
2829

2930
## [v0.15.0] - 2023-03-13
3031

src/gpio/alt.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{Alternate, NoPin, OpenDrain, PinMode};
1+
use super::{marker, Alternate, NoPin, OpenDrain, PinMode};
22
use crate::gpio::{self, Edge, ExtiPin};
33
use crate::pac::EXTI;
44
use crate::syscfg::SysCfg;
@@ -122,8 +122,11 @@ macro_rules! pin {
122122

123123
$(
124124
$(#[$attr])*
125-
impl From<gpio::$PX> for $name {
126-
fn from(p: gpio::$PX) -> Self {
125+
impl<MODE> From<gpio::$PX<MODE>> for $name
126+
where
127+
MODE: marker::NotAlt + PinMode
128+
{
129+
fn from(p: gpio::$PX<MODE>) -> Self {
127130
Self::$PX(p.into_mode())
128131
}
129132
}

0 commit comments

Comments
 (0)