Merge pull request #1924 from embassy-rs/rp-remove-paste

rp: remove paste macro.
This commit is contained in:
Dario Nieuwenhuis 2023-09-18 01:33:55 +00:00 committed by GitHub
commit 183824fbdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 9 deletions

View File

@ -89,7 +89,6 @@ embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.1", optional =
embedded-hal-async = { version = "=1.0.0-rc.1", optional = true} embedded-hal-async = { version = "=1.0.0-rc.1", optional = true}
embedded-hal-nb = { version = "=1.0.0-rc.1", optional = true} embedded-hal-nb = { version = "=1.0.0-rc.1", optional = true}
paste = "1.0"
pio-proc = {version= "0.2" } pio-proc = {version= "0.2" }
pio = {version= "0.2.1" } pio = {version= "0.2.1" }
rp2040-boot2 = "0.3" rp2040-boot2 = "0.3"

View File

@ -1079,18 +1079,43 @@ impl_pio!(PIO1, 1, PIO1, PIO1_0, PIO1_IRQ_0);
pub trait PioPin: sealed::PioPin + gpio::Pin {} pub trait PioPin: sealed::PioPin + gpio::Pin {}
macro_rules! impl_pio_pin { macro_rules! impl_pio_pin {
($( $num:tt )*) => { ($( $pin:ident, )*) => {
$( $(
paste::paste!{ impl sealed::PioPin for peripherals::$pin {}
impl sealed::PioPin for peripherals::[< PIN_ $num >] {} impl PioPin for peripherals::$pin {}
impl PioPin for peripherals::[< PIN_ $num >] {}
}
)* )*
}; };
} }
impl_pio_pin! { impl_pio_pin! {
0 1 2 3 4 5 6 7 8 9 PIN_0,
10 11 12 13 14 15 16 17 18 19 PIN_1,
20 21 22 23 24 25 26 27 28 29 PIN_2,
PIN_3,
PIN_4,
PIN_5,
PIN_6,
PIN_7,
PIN_8,
PIN_9,
PIN_10,
PIN_11,
PIN_12,
PIN_13,
PIN_14,
PIN_15,
PIN_16,
PIN_17,
PIN_18,
PIN_19,
PIN_20,
PIN_21,
PIN_22,
PIN_23,
PIN_24,
PIN_25,
PIN_26,
PIN_27,
PIN_28,
PIN_29,
} }