Move most of DMA out of gen.py.

This commit is contained in:
Bob McWhirter
2021-06-03 14:53:48 -04:00
parent 240616aa72
commit b4dca64e20
2 changed files with 27 additions and 7 deletions

View File

@ -60,15 +60,10 @@ with open(output_file, 'w') as f:
if block_mod == 'dma':
custom_singletons = True
num_dmas += 1
dma_num = int(name[3:])-1 # substract 1 because we want DMA1=0, DMA2=1
for ch_num in range(8):
channel = f'{name}_CH{ch_num}'
singletons.append(channel)
f.write(f'impl_dma_channel!({channel}, {dma_num}, {ch_num});')
if not custom_singletons:
singletons.append(name)