Prevent crash if xENR exists but xRSTR doesn't

This commit is contained in:
Grant Miller 2022-04-26 21:39:16 -05:00
parent c36a510e47
commit 9ea9bd5215

View File

@ -1268,7 +1268,7 @@ def parse_rcc_regs():
'field': field['name'], 'field': field['name'],
} }
} }
if rstr := y[key.replace('ENR', 'RSTR')]: if rstr := y.get(key.replace('ENR', 'RSTR')):
if field := next(filter(lambda f: f['name'] == f'{peri}RST', rstr['fields']), None): if field := next(filter(lambda f: f['name'] == f'{peri}RST', rstr['fields']), None):
res['reset'] = { res['reset'] = {
'register': reg.replace('ENR', 'RSTR'), 'register': reg.replace('ENR', 'RSTR'),