diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2023-01-19 10:59:22 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-01-19 10:59:22 +0000 |
| commit | 65ab714fae6315a032e7440f44429ced36d2506e (patch) | |
| tree | 25fe848f7e5fb2c9a79f997acd4eda5ae9a162c8 | |
| parent | f0ae1f9133463459a7ad06aa15fb899c2f4185e2 (diff) | |
| parent | 83af513424b3fcff98ca7bc12cc4e24261eb08e7 (diff) | |
Merge #1162
1162: rp gpio: make pin_bank() inline r=Dirbaio a=mkj
This allows set_high() etc to be inlined, toggling pins should be much faster.
Co-authored-by: Matt Johnston <[email protected]>
| -rw-r--r-- | embassy-rp/src/gpio.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs index ec05de611..4abb98394 100644 --- a/embassy-rp/src/gpio.rs +++ b/embassy-rp/src/gpio.rs | |||
| @@ -743,6 +743,7 @@ macro_rules! impl_pin { | |||
| 743 | ($name:ident, $bank:expr, $pin_num:expr) => { | 743 | ($name:ident, $bank:expr, $pin_num:expr) => { |
| 744 | impl Pin for peripherals::$name {} | 744 | impl Pin for peripherals::$name {} |
| 745 | impl sealed::Pin for peripherals::$name { | 745 | impl sealed::Pin for peripherals::$name { |
| 746 | #[inline] | ||
| 746 | fn pin_bank(&self) -> u8 { | 747 | fn pin_bank(&self) -> u8 { |
| 747 | ($bank as u8) * 32 + $pin_num | 748 | ($bank as u8) * 32 + $pin_num |
| 748 | } | 749 | } |
