Parse memory names slightly better from the XML.

This commit is contained in:
Bob McWhirter 2021-07-30 13:58:54 -04:00
parent 72478d1bc5
commit 83f5b39ecb
2 changed files with 7 additions and 3 deletions

View File

@ -304,7 +304,7 @@
- device-id: 0x440
names:
- STM32F05x
- STMF030x8
- STM32F030x8
ram:
address: 0x20000000
bytes: 0x1ff8
@ -323,7 +323,7 @@
- device-id: 0x442
names:
- STM32F09x
- STMF030xC
- STM32F030xC
ram:
address: 0x20000000
bytes: 0x8000
@ -351,7 +351,7 @@
- device-id: 0x445
names:
- STM32F04x
- STMF070x6
- STM32F070x6
ram:
address: 0x20000000
bytes: 0x1800

View File

@ -35,6 +35,8 @@ def splat_names(base, parts):
for part in parts:
if part.startswith("STM32"):
names.append( base )
elif part.startswith( base[5]):
names.append('STM32' + part)
else:
names.append( base[0: len(base) - len(part)] + part)
@ -56,6 +58,8 @@ def split_names(str):
elif name.startswith("STM32"):
current_base = name
cleaned.append(name)
elif name.startswith( current_base[5]):
names.append('STM32' + name)
else:
cleaned.append( current_base[0: len(current_base) - len(name)] + name)
return cleaned