Skip to content

Commit

Permalink
arduino-hal: provide renamed types matching fields
Browse files Browse the repository at this point in the history
A very simple improvement to fix #558 and fix #555.
  • Loading branch information
LuigiPiucco committed Jun 10, 2024
1 parent 38549cc commit c4b4bef
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions avr-hal-generic/src/port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -781,13 +781,18 @@ macro_rules! renamed_pins {
type McuPins = $mcu_pins:ty;
}
) => {
$(#[$pins_attr])*
pub struct Pins {
$($(#[$pin_attr])*
pub $pin_name: $pin_wrapper<
$crate::port::mode::Input<$crate::port::mode::Floating>,
$pin_type,
>,)+
$crate::paste::paste! {
$(#[$pins_attr])*
pub struct Pins {
$(pub $pin_name: $pin_wrapper<
$crate::port::mode::Input<$crate::port::mode::Floating>,
[<$pin_name:upper>],
>,)+
}
}

$crate::paste::paste! {
$($(#[$pin_attr])* pub type [<$pin_name:upper>] = $pin_type;)+
}

impl Pins {
Expand Down

0 comments on commit c4b4bef

Please sign in to comment.