Skip to content

Commit

Permalink
Tools: fix handling of include files for Periph
Browse files Browse the repository at this point in the history
This fix scans all the include files in a hwdef, not just one on the
first line.
  • Loading branch information
robertlong13 authored and peterbarker committed May 24, 2024
1 parent d16ff40 commit ead48b6
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Tools/ardupilotwaf/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,15 +609,13 @@ def get_ap_periph_boards():
list_ap.append(d)
continue
# process any include lines:
m = re.match(r"include\s+([^\s]*)", content)
if m is None:
continue
include_path = os.path.join(os.path.dirname(hwdef), m.group(1))
with open(include_path, "r") as g:
content = g.read()
if 'AP_PERIPH' in content:
list_ap.append(d)
continue
for m in re.finditer(r"^include\s+([^\s]*)", content, re.MULTILINE):
include_path = os.path.join(os.path.dirname(hwdef), m.group(1))
with open(include_path, "r") as g:
content = g.read()
if 'AP_PERIPH' in content:
list_ap.append(d)
break

list_ap = list(set(list_ap))
return list_ap
Expand Down

0 comments on commit ead48b6

Please sign in to comment.