mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-11 17:13:56 -03:00
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:
parent
d16ff40162
commit
ead48b6737
@ -609,15 +609,13 @@ def get_ap_periph_boards():
|
|||||||
list_ap.append(d)
|
list_ap.append(d)
|
||||||
continue
|
continue
|
||||||
# process any include lines:
|
# process any include lines:
|
||||||
m = re.match(r"include\s+([^\s]*)", content)
|
for m in re.finditer(r"^include\s+([^\s]*)", content, re.MULTILINE):
|
||||||
if m is None:
|
include_path = os.path.join(os.path.dirname(hwdef), m.group(1))
|
||||||
continue
|
with open(include_path, "r") as g:
|
||||||
include_path = os.path.join(os.path.dirname(hwdef), m.group(1))
|
content = g.read()
|
||||||
with open(include_path, "r") as g:
|
if 'AP_PERIPH' in content:
|
||||||
content = g.read()
|
list_ap.append(d)
|
||||||
if 'AP_PERIPH' in content:
|
break
|
||||||
list_ap.append(d)
|
|
||||||
continue
|
|
||||||
|
|
||||||
list_ap = list(set(list_ap))
|
list_ap = list(set(list_ap))
|
||||||
return list_ap
|
return list_ap
|
||||||
|
Loading…
Reference in New Issue
Block a user