Add a single-column variant to gpio_rcc! macro table
which includes just the set of registers that need to be considered. Then match against those registers with a single `modify(...)`
This commit is contained in:
@ -452,9 +452,13 @@ crate::pac::pins!(
|
||||
|
||||
pub(crate) unsafe fn init() {
|
||||
crate::pac::gpio_rcc! {
|
||||
($name:ident, $clock:ident, $en_reg:ident, $rst_reg:ident, $en_fn:ident, $rst_fn:ident) => {
|
||||
($en_reg:ident) => {
|
||||
crate::pac::RCC.$en_reg().modify(|reg| {
|
||||
reg.$en_fn(true);
|
||||
crate::pac::gpio_rcc! {
|
||||
($name:ident, $clock:ident, $en_reg, $rst_reg:ident, $en_fn:ident, $rst_fn:ident) => {
|
||||
reg.$en_fn(true);
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user