Tools: fix handling of include files for Periph

This fix scans all the include files in a hwdef, not just one on the
first line.
This commit is contained in:
Bob Long 2024-05-22 23:49:22 -05:00 committed by Peter Barker
parent d16ff40162
commit ead48b6737
1 changed files with 7 additions and 9 deletions

View File

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