From 83af513424b3fcff98ca7bc12cc4e24261eb08e7 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Thu, 19 Jan 2023 13:29:51 +0800 Subject: [PATCH] rp gpio: make pin_bank() inline This allows set_high() etc to be inlined, toggling pins should be much faster. --- embassy-rp/src/gpio.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs index ec05de61..4abb9839 100644 --- a/embassy-rp/src/gpio.rs +++ b/embassy-rp/src/gpio.rs @@ -743,6 +743,7 @@ macro_rules! impl_pin { ($name:ident, $bank:expr, $pin_num:expr) => { impl Pin for peripherals::$name {} impl sealed::Pin for peripherals::$name { + #[inline] fn pin_bank(&self) -> u8 { ($bank as u8) * 32 + $pin_num }