aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xtools/gen-device-svd.py28
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: