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 <matt@ucc.asn.au>
This commit is contained in:
commit
65ab714fae
@ -743,6 +743,7 @@ macro_rules! impl_pin {
|
|||||||
($name:ident, $bank:expr, $pin_num:expr) => {
|
($name:ident, $bank:expr, $pin_num:expr) => {
|
||||||
impl Pin for peripherals::$name {}
|
impl Pin for peripherals::$name {}
|
||||||
impl sealed::Pin for peripherals::$name {
|
impl sealed::Pin for peripherals::$name {
|
||||||
|
#[inline]
|
||||||
fn pin_bank(&self) -> u8 {
|
fn pin_bank(&self) -> u8 {
|
||||||
($bank as u8) * 32 + $pin_num
|
($bank as u8) * 32 + $pin_num
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user