From dc4a94e868e360ff1081c9b849986ee61bc89a0f Mon Sep 17 00:00:00 2001 From: Bob McWhirter Date: Fri, 29 Oct 2021 13:08:21 -0400 Subject: [PATCH] Parse out U5xx packages. Avoid barfing if we're not yet parsing DMA, because we aren't for GPDMA. --- parse.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/parse.py b/parse.py index f9ae242..023f24d 100755 --- a/parse.py +++ b/parse.py @@ -585,6 +585,7 @@ def chip_name_from_package_name(x): ('(STM32L5....).x[PQ]', '\\1'), ('(STM32L0....).xS', '\\1'), ('(STM32H7....).xQ', '\\1'), + ('(STM32U5....).xQ', '\\1'), ('(STM32......).x', '\\1'), ] @@ -1074,16 +1075,17 @@ def parse_chips(): core['dma_channels'] = chs # Process peripheral - DMA channel associations - for pname, p in peris.items(): - if (peri_chs := dma_channels[chip_dma]['peripherals'].get(pname)) is not None: - p['dma_channels'] = { - req: [ - ch - for ch in req_chs - if ('channel' not in ch) or ch['channel'] in chs - ] - for req, req_chs in peri_chs.items() - } + if chip_dma is not None: + for pname, p in peris.items(): + if (peri_chs := dma_channels[chip_dma]['peripherals'].get(pname)) is not None: + p['dma_channels'] = { + req: [ + ch + for ch in req_chs + if ('channel' not in ch) or ch['channel'] in chs + ] + for req, req_chs in peri_chs.items() + } # remove all pins from the root of the chip before emitting. del chip['pins']