Skip to content

Commit e4805cb

Browse files
Do not use precompiled sketches and skip core installation for new boards
1 parent fe31ef7 commit e4805cb

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

generator/generator.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,16 @@ def generate_boards_json(input_data, arduino_cli_path):
245245
"arduino:renesas_uno:unor4wifi": {"fqbn": "arduino:renesas_uno:unor4wifi", "firmware": []},
246246
}
247247

248+
# List of old boards that need precompiled sketch data and uploader information obtained through platform.txt.
249+
old_boards = ["arduino:samd:mkr1000","arduino:samd:nano_33_iot","arduino:samd:mkrvidor4000","arduino:megaavr:uno2018","arduino:mbed_nano:nanorp2040connect"]
250+
248251
# Gets the installed cores
249252
res = arduino_cli(cli_path=arduino_cli_path, args=["core", "list", "--format", "json"])
250253
installed_cores = {c["id"]: c for c in json.loads(res)}
251254

252255
# Verify all necessary cores are installed
253256
# TODO: Should we check that the latest version is installed too?
254-
for fqbn in boards.keys():
257+
for fqbn in old_boards:
255258
core_id = ":".join(fqbn.split(":")[:2])
256259
if core_id not in installed_cores:
257260
print(f"Board {fqbn} is not installed, install its core {core_id}")
@@ -260,8 +263,9 @@ def generate_boards_json(input_data, arduino_cli_path):
260263
for fqbn, data in input_data.items():
261264
simple_fqbn = fqbn.replace(":", ".")
262265

263-
boards[fqbn]["loader_sketch"] = create_precomp_sketch_data(simple_fqbn, "loader")
264-
boards[fqbn]["version_sketch"] = create_precomp_sketch_data(simple_fqbn, "getversion")
266+
if fqbn in old_boards:
267+
boards[fqbn]["loader_sketch"] = create_precomp_sketch_data(simple_fqbn, "loader")
268+
boards[fqbn]["version_sketch"] = create_precomp_sketch_data(simple_fqbn, "getversion")
265269

266270
for firmware_version in data["versions"]:
267271
module = data["moduleName"]
@@ -279,7 +283,8 @@ def generate_boards_json(input_data, arduino_cli_path):
279283
boards[fqbn]["name"] = board["name"]
280284
break
281285

282-
boards[fqbn].update(create_upload_data(fqbn, installed_cores))
286+
if fqbn in old_boards:
287+
boards[fqbn].update(create_upload_data(fqbn, installed_cores))
283288

284289
boards_json = []
285290
for _, b in boards.items():

0 commit comments

Comments
 (0)