mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
HAL_ChibiOS: fixed regex error for GPIOs
This commit is contained in:
parent
d3742989ef
commit
97aee6f45e
@ -558,9 +558,9 @@ class generic_pin(object):
|
|||||||
def periph_instance(self):
|
def periph_instance(self):
|
||||||
'''return peripheral instance'''
|
'''return peripheral instance'''
|
||||||
if self.periph_type() == 'PERIPH_TYPE::GPIO':
|
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:
|
else:
|
||||||
result = re.match(r'[A-Z_]*([0-9]*)', self.type)
|
result = re.match(r'[A-Z_]*([0-9]+)', self.type)
|
||||||
if result:
|
if result:
|
||||||
return int(result.group(1))
|
return int(result.group(1))
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user