mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-26 20:00:27 +00:00
stm32/afio: fix accidentally always using AF number 0 on non-AFIO chips.
This commit is contained in:
parent
a23c4b7bca
commit
23d5c7efd9
@ -1428,13 +1428,13 @@ fn main() {
|
||||
"LPUART",
|
||||
"TIM",
|
||||
];
|
||||
let af_or_not_applicable = if peripherals_with_afio.iter().any(|&x| p.name.starts_with(x)) {
|
||||
quote!(0, crate::gpio::AfioRemapNotApplicable)
|
||||
let not_applicable = if peripherals_with_afio.iter().any(|&x| p.name.starts_with(x)) {
|
||||
quote!(, crate::gpio::AfioRemapNotApplicable)
|
||||
} else {
|
||||
quote!(#af)
|
||||
quote!()
|
||||
};
|
||||
|
||||
Some(quote!(pin_trait_impl!(#tr, #peri, #pin_name, #af_or_not_applicable);))
|
||||
Some(quote!(pin_trait_impl!(#tr, #peri, #pin_name, #af #not_applicable);))
|
||||
};
|
||||
|
||||
g.extend(pin_trait_impl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user