From ea9e59931f67a2dd8ba212982f521f0cd6983f88 Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Tue, 8 Mar 2022 16:14:45 -0600 Subject: [PATCH] Don't rename DMA channels if they don't start at zero --- stm32data/__main__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/stm32data/__main__.py b/stm32data/__main__.py index 2e985ea..d2b3ab2 100755 --- a/stm32data/__main__.py +++ b/stm32data/__main__.py @@ -1077,15 +1077,12 @@ def parse_dma(): if result := re.match('.*' + n + '_(Channel|Stream)\[(\d+)-(\d+)\]', channels[0]['@Name']): low = int(result.group(2)) high = int(result.group(3)) - # Make sure all channels numbers start at 0 - if low == 1: - low -= 1 - high -= 1 for i in range(low, high + 1): chip_dma['channels'].append({ 'name': n + '_CH' + str(i), 'dma': n, - 'channel': i, + # Make sure all channels numbers start at 0 + 'channel': i - low, 'dmamux': dmamux, 'dmamux_channel': dmamux_channel, })