diff --git a/buildroot/share/scripts/pinsformat.py b/buildroot/share/scripts/pinsformat.py index 7b041c86fc..0260d3174e 100755 --- a/buildroot/share/scripts/pinsformat.py +++ b/buildroot/share/scripts/pinsformat.py @@ -43,7 +43,7 @@ mexpr = [ re.compile(f'^{m}$') for m in mpatt ] ppad = [ 3, 4, 5, 5 ] # Match a define line -definePatt = re.compile(rf'^\s*(//)?#define\s+[A-Z_][A-Z0-9_]+\s+({mstr})\s*(//.*)?$') +definePinPatt = re.compile(rf'^\s*(//)?#define\s+[A-Z_][A-Z0-9_]+?_PIN\s+({mstr})\s*(//.*)?$') def format_pins(argv): src_file = 'stdin' @@ -93,7 +93,7 @@ def get_pin_pattern(txt): # Find the most common matching pattern match_threshold = 5 for line in txt.split('\n'): - r = definePatt.match(line) + r = definePinPatt.match(line) if r == None: continue ind = -1 for p in mexpr: