mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 16:23:10 +00:00
Use match instead of if
This commit is contained in:
parent
32a75cb764
commit
fab434ae84
@ -108,9 +108,10 @@ macro_rules! new_pin {
|
|||||||
pin.set_as_af_pull(pin.af_num(), $aftype, $pull);
|
pin.set_as_af_pull(pin.af_num(), $aftype, $pull);
|
||||||
// Do not call set_speed on AFType::Input, as MODE and CNF bits are not independent
|
// Do not call set_speed on AFType::Input, as MODE and CNF bits are not independent
|
||||||
// for gpio_v1
|
// for gpio_v1
|
||||||
if $aftype != crate::gpio::AFType::Input {
|
match $aftype {
|
||||||
pin.set_speed($speed);
|
crate::gpio::AFType::Input => {},
|
||||||
}
|
_ => pin.set_speed($speed);
|
||||||
|
};
|
||||||
Some(pin.map_into())
|
Some(pin.map_into())
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user