🧑💻 Fix pinsformat.py pin pattern recognition
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user