mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 11:07:46 +00:00
tools/gen-device-svd: fix interrupts for derived peripherals
This commit is contained in:
+14
-14
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user