diff options
author | Ayke van Laethem <[email protected]> | 2018-10-03 20:06:13 +0200 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2018-10-03 20:06:13 +0200 |
commit | b36b9c24a280ae207edf633764304caf77ff170a (patch) | |
tree | 7dad673b5b3bbc5f96068b7babe27df56e9bb72d /tools | |
parent | 9d408b7cbce6558be21a7b06ea98978f7d18a932 (diff) | |
download | tinygo-b36b9c24a280ae207edf633764304caf77ff170a.tar.gz tinygo-b36b9c24a280ae207edf633764304caf77ff170a.zip |
tools/gen-device-svd: fix interrupts for derived peripherals
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/gen-device-svd.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/gen-device-svd.py b/tools/gen-device-svd.py index 167d4e2aa..ab361d139 100755 --- a/tools/gen-device-svd.py +++ b/tools/gen-device-svd.py @@ -54,6 +54,20 @@ def readSVD(path, sourceURL): if groupNameTags: groupName = getText(groupNameTags[0]) + for interrupt in periphEl.findall('interrupt'): + intrName = getText(interrupt.find('name')) + intrIndex = int(getText(interrupt.find('value'))) + if intrName in interrupts: + if interrupts[intrName]['index'] != intrIndex: + raise ValueError('interrupt with the same name has different indexes: ' + intrName) + interrupts[intrName]['description'] += ' // ' + description + else: + interrupts[intrName] = { + 'name': intrName, + 'index': intrIndex, + 'description': description, + } + if periphEl.get('derivedFrom') or groupName in groups: if periphEl.get('derivedFrom'): derivedFromName = periphEl.get('derivedFrom') @@ -83,20 +97,6 @@ def readSVD(path, sourceURL): if groupName and groupName not in groups: groups[groupName] = peripheral - for interrupt in periphEl.findall('interrupt'): - intrName = getText(interrupt.find('name')) - intrIndex = int(getText(interrupt.find('value'))) - if intrName in interrupts: - if interrupts[intrName]['index'] != intrIndex: - raise ValueError('interrupt with the same name has different indexes: ' + intrName) - interrupts[intrName]['description'] += ' // ' + description - else: - interrupts[intrName] = { - 'name': intrName, - 'index': intrIndex, - 'description': description, - } - regsEls = periphEl.findall('registers') if regsEls: if len(regsEls) != 1: |