0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-03-15 02:36:19 +00:00

🧑‍💻 Fix pinsformat.py pin pattern recognition

This commit is contained in:
Scott Lahteine 2024-11-03 16:38:21 -06:00
parent c2d0008d2a
commit 4869a3ffd9

View file

@ -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: