From 4869a3ffd97a10f6122cbf1aa4920d6881b62bea Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Nov 2024 16:38:21 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Fix=20pinsf?= =?UTF-8?q?ormat.py=20pin=20pattern=20recognition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/scripts/pinsformat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildroot/share/scripts/pinsformat.py b/buildroot/share/scripts/pinsformat.py index 7b041c86fcb2..0260d3174e17 100755 --- a/buildroot/share/scripts/pinsformat.py +++ b/buildroot/share/scripts/pinsformat.py @@ -43,7 +43,7 @@ def concat_with_space(s1, s2): 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: