HAL_ChibiOS: fixed regex error for GPIOs

This commit is contained in:
Andrew Tridgell 2021-11-05 15:22:48 +11:00
parent d3742989ef
commit 97aee6f45e
1 changed files with 2 additions and 2 deletions

View File

@ -558,9 +558,9 @@ class generic_pin(object):
def periph_instance(self):
'''return peripheral instance'''
if self.periph_type() == 'PERIPH_TYPE::GPIO':
result = re.match(r'[A-Z_]*([0-9]*)', self.label)
result = re.match(r'[A-Z_]*([0-9]+)', self.label)
else:
result = re.match(r'[A-Z_]*([0-9]*)', self.type)
result = re.match(r'[A-Z_]*([0-9]+)', self.type)
if result:
return int(result.group(1))
return 0