Skip to content

Commit c619a2c

Browse files
authored
Merge pull request #610 from stm32-rs/from-output
enum from output
2 parents 557b7f2 + c19e735 commit c619a2c

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
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
}

src/uart.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,17 +271,15 @@ impl Instance for pac::UART4 {
271271
}
272272
}
273273

274-
use crate::serial::halUsart;
275-
276274
#[cfg(feature = "uart5")]
277275
#[cfg(any(feature = "stm32f413", feature = "stm32f423"))]
278-
halUsart! { pac::UART5, uart5, Serial5, Rx5, Tx5 }
276+
crate::serial::halUsart! { pac::UART5, uart5, Serial5, Rx5, Tx5 }
279277

280278
#[cfg(feature = "uart7")]
281-
halUsart! { pac::UART7, uart7, Serial7, Rx7, Tx7 }
279+
crate::serial::halUsart! { pac::UART7, uart7, Serial7, Rx7, Tx7 }
282280
#[cfg(feature = "uart8")]
283-
halUsart! { pac::UART8, uart8, Serial8, Rx8, Tx8 }
281+
crate::serial::halUsart! { pac::UART8, uart8, Serial8, Rx8, Tx8 }
284282
#[cfg(feature = "uart9")]
285-
halUsart! { pac::UART9, uart9, Serial9, Rx9, Tx9 }
283+
crate::serial::halUsart! { pac::UART9, uart9, Serial9, Rx9, Tx9 }
286284
#[cfg(feature = "uart10")]
287-
halUsart! { pac::UART10, uart10, Serial10, Rx10, Tx10 }
285+
crate::serial::halUsart! { pac::UART10, uart10, Serial10, Rx10, Tx10 }

0 commit comments

Comments
 (0)