Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2064371

Browse files
Simplify parsing of adressOffset
Co-authored-by: Adam Greig <[email protected]>
1 parent 283e8c7 commit 2064371

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

scripts/makehtml.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ def parse_device(svdfile):
6969
rdesc = rtag.findtext('description')
7070
rrstv = rtag.findtext('resetValue')
7171
raccs = rtag.findtext('access') or "Unspecified"
72-
addr_offset = rtag.findtext('addressOffset')
73-
roffset = int(addr_offset, 16 if addr_offset.startswith('0x') else 10)
72+
roffset = int(rtag.findtext('addressOffset'), 0)
7473
for ftag in rtag.iter('field'):
7574
register_fields_total += 1
7675
fname = ftag.findtext('name')

0 commit comments

Comments
 (0)