From 97aee6f45ebbe8c55738981375f6d8d69f659b85 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 5 Nov 2021 15:22:48 +1100 Subject: [PATCH] HAL_ChibiOS: fixed regex error for GPIOs --- libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 1646d9ed57..c440b8ea9f 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -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