Skip to content

Commit b83c180

Browse files
committed
simplify Outport
1 parent c619a2c commit b83c180

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
- Simplify `gpio::Outport`
1011
- Split USART and UART implementations
1112
- Add `lapce` editor settings [#601]
1213
- Use `enum`s for alternate peripheral pins [#594] [#610]

src/gpio/outport.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ pub trait OutPort {
77
}
88

99
macro_rules! out_port {
10-
( $name:ident => $n:literal, ( $($i:literal),+ ), ( $($N:ident),+ )) => {
10+
( $name:ident => $n:literal, ( $($i:tt),+ ), ( $($N:ident),+ )) => {
1111
pub struct $name<const P: char $(, const $N: u8)+> (
12-
pub ($(Pin<P, $N, Output<PushPull>>,)+)
12+
$(pub Pin<P, $N, Output<PushPull>>,)+
1313
);
1414

1515
impl<const P: char $(, const $N: u8)+> OutPort for ($(Pin<P, $N, Output<PushPull>>),+) {
1616
type Target = $name<P $(, $N)+>;
1717
fn outport(self) -> Self::Target {
18-
$name(self)
18+
$name($(self.$i),+)
1919
}
2020
}
2121

0 commit comments

Comments
 (0)