Slightly improve DMA parsing wrt H7 weirdness.
This commit is contained in:
parent
7a7b14ed4b
commit
4823bfee64
16
parse.py
16
parse.py
@ -827,9 +827,12 @@ dma_channels = {}
|
|||||||
|
|
||||||
|
|
||||||
def parse_dma():
|
def parse_dma():
|
||||||
|
for f in glob('sources/cubedb/mcu/IP/*DMA-*Modes.xml'):
|
||||||
for f in glob('sources/cubedb/mcu/IP/DMA-*Modes.xml'):
|
ff = removeprefix(f, 'sources/cubedb/mcu/IP/')
|
||||||
ff = removeprefix(f, 'sources/cubedb/mcu/IP/DMA-')
|
if not ( ff.startswith('B') or ff.startswith( 'D' ) ):
|
||||||
|
continue
|
||||||
|
ff = removeprefix(ff, 'DMA-')
|
||||||
|
ff = removeprefix(ff, 'BDMA-')
|
||||||
ff = removesuffix(ff, '_Modes.xml')
|
ff = removesuffix(ff, '_Modes.xml')
|
||||||
|
|
||||||
r = xmltodict.parse(open(f, 'rb'), force_list={'Mode', 'RefMode'})
|
r = xmltodict.parse(open(f, 'rb'), force_list={'Mode', 'RefMode'})
|
||||||
@ -871,14 +874,15 @@ def parse_dma():
|
|||||||
request_num += 1
|
request_num += 1
|
||||||
for n in dma_peri_name.split(","):
|
for n in dma_peri_name.split(","):
|
||||||
n = n.strip()
|
n = n.strip()
|
||||||
if result := re.match('.*' + n + '_Channel\[(\d+)-(\d+)\]', channels[0]['@Name']):
|
if result := re.match('.*' + n + '_(Channel|Stream)\[(\d+)-(\d+)\]', channels[0]['@Name']):
|
||||||
low = int(result.group(1))
|
low = int(result.group(2))
|
||||||
high = int(result.group(2))
|
high = int(result.group(3))
|
||||||
for i in range(low, high+1):
|
for i in range(low, high+1):
|
||||||
chip_dma['channels'][n+'_'+str(i)] = OrderedDict({
|
chip_dma['channels'][n+'_'+str(i)] = OrderedDict({
|
||||||
'dma': n,
|
'dma': n,
|
||||||
'channel': i,
|
'channel': i,
|
||||||
})
|
})
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# see if we can scrape out requests
|
# see if we can scrape out requests
|
||||||
requests = {}
|
requests = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user