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.
 - SW-159
  • Loading branch information
robertlong13 committed Aug 15, 2024
1 parent 536debe commit 34a9ab2
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 @@ -590,15 +590,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 34a9ab2

Please sign in to comment.