mx2board: cleanup pin data

This commit is contained in:
Fabien Poussin 2021-02-08 12:45:02 +01:00
parent d610e9ad14
commit 0a0aa7491d
No known key found for this signature in database
GPG Key ID: 6166CABA99FC385C
1 changed files with 6 additions and 8 deletions

View File

@ -229,14 +229,12 @@ def read_project(gpio, filename):
pads[p][i]['OSPEEDR'] = PIN_OSPEED_TRANSLATE[gpio['defaults']['GPIO_Speed']]
for t in tmp:
if re.search(r"^P[A-Z]\d{1,2}(_C|-OSC.+|\\.*SW.*)?\.", t, re.M):
split = t.split('=')
pad_name = split[0].split(".")[0].replace('\\', '').replace('_C', '')
pad_port = pad_name[1:2]
pad_num = int(pad_name[2:4].replace('.', '').replace('-', ''))
pad_prop = split[0].split(".")[-1].replace(" ", "")
prop_value = split[-1].rstrip('\r\n')
_pad_search = re.match(r"^P([A-Z])(\d{1,2}).*\.([A-Za-z_]+)=(.+)", t, re.M)
if _pad_search:
pad_port = _pad_search.group(1)
pad_num = int(_pad_search.group(2))
pad_prop = _pad_search.group(3)
prop_value = _pad_search.group(4)
if pad_prop == "Signal":
if 'S_TIM' in prop_value: