Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Fix pinsformat.py pin pattern recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Nov 3, 2024
1 parent c2d0008 commit 4869a3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions buildroot/share/scripts/pinsformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 4869a3f

Please sign in to comment.