Remove ad-hoc imports from generated code.
This commit is contained in:
parent
da16c60487
commit
f96db3d9d2
@ -118,7 +118,7 @@ for chip in chips.values():
|
||||
if block_mod == 'rng':
|
||||
for irq in chip['interrupts']:
|
||||
if re.search('RNG', irq):
|
||||
f.write(f'impl_rng!({name}, ' + irq + f');')
|
||||
f.write(f'impl_rng!({name}, {irq});')
|
||||
|
||||
if block_mod == 'spi':
|
||||
if 'clock' in peri:
|
||||
@ -182,7 +182,6 @@ for chip in chips.values():
|
||||
if func := funcs.get(f'{name}_D7'):
|
||||
f.write(f'impl_sdmmc_pin!({name}, D7Pin, {pin}, {func});')
|
||||
|
||||
|
||||
if block_mod == 'exti':
|
||||
for irq in chip['interrupts']:
|
||||
if re.match('EXTI', irq):
|
||||
@ -201,7 +200,6 @@ for chip in chips.values():
|
||||
peripherals!({','.join(peripheral_names)});
|
||||
""")
|
||||
|
||||
|
||||
# ========= DMA peripherals
|
||||
if num_dmas > 0:
|
||||
f.write(f"""
|
||||
@ -219,9 +217,6 @@ for chip in chips.values():
|
||||
# ========= exti interrupts
|
||||
|
||||
f.write(f"""
|
||||
use embassy::interrupt::Interrupt;
|
||||
use embassy::interrupt::InterruptExt;
|
||||
|
||||
impl_exti_irq!({','.join(exti_interrupts)});
|
||||
""")
|
||||
|
||||
|
@ -216,6 +216,9 @@ macro_rules! impl_exti_irq {
|
||||
($($e:ident),+) => {
|
||||
/// safety: must be called only once
|
||||
pub(crate) unsafe fn init_exti() {
|
||||
use embassy::interrupt::Interrupt;
|
||||
use embassy::interrupt::InterruptExt;
|
||||
|
||||
$(
|
||||
crate::interrupt::$e::steal().enable();
|
||||
)+
|
||||
|
Loading…
Reference in New Issue
Block a user