From bc28efb0e3395a6c0bf827c152186e124ed31828 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 22 Mar 2024 11:04:37 +1100 Subject: [PATCH] chibios_hwdef.py: correct extraction of intdefines from hwdef files many of our hwdef files contain lines which look like this: define STM32_PWM_USE_ADVANCED TRUE The current regex does not allow for numbers in those define, so the regex ends up matching "STM" as a name.... the "intdefines" hash which is populated from these is only used internally to chibios_hwdey.py for logic purposes, not directly in hwdef output purposes, and none of the strings which it looks at contain numbers at the moment, so this is a non-functional change. --- libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 148cd4277a17b..ff8cb22e7301d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -3072,7 +3072,7 @@ def process_line(self, line): self.env_vars[name] = value elif a[0] == 'define': # extract numerical defines for processing by other parts of the script - result = re.match(r'define\s*([A-Z_]+)\s*([0-9]+)', line) + result = re.match(r'define\s*([A-Z_0-9]+)\s*([0-9]+)', line) if result: self.intdefines[result.group(1)] = int(result.group(2))