Skip to content

Commit a535203

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

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

generator/generator.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,22 @@ 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 = [
250+
"arduino:samd:mkr1000",
251+
"arduino:samd:nano_33_iot",
252+
"arduino:samd:mkrvidor4000",
253+
"arduino:megaavr:uno2018",
254+
"arduino:mbed_nano:nanorp2040connect"
255+
]
256+
248257
# Gets the installed cores
249258
res = arduino_cli(cli_path=arduino_cli_path, args=["core", "list", "--format", "json"])
250259
installed_cores = {c["id"]: c for c in json.loads(res)}
251260

252261
# Verify all necessary cores are installed
253262
# TODO: Should we check that the latest version is installed too?
254-
for fqbn in boards.keys():
263+
for fqbn in old_boards:
255264
core_id = ":".join(fqbn.split(":")[:2])
256265
if core_id not in installed_cores:
257266
print(f"Board {fqbn} is not installed, install its core {core_id}")
@@ -260,8 +269,9 @@ def generate_boards_json(input_data, arduino_cli_path):
260269
for fqbn, data in input_data.items():
261270
simple_fqbn = fqbn.replace(":", ".")
262271

263-
boards[fqbn]["loader_sketch"] = create_precomp_sketch_data(simple_fqbn, "loader")
264-
boards[fqbn]["version_sketch"] = create_precomp_sketch_data(simple_fqbn, "getversion")
272+
if fqbn in old_boards:
273+
boards[fqbn]["loader_sketch"] = create_precomp_sketch_data(simple_fqbn, "loader")
274+
boards[fqbn]["version_sketch"] = create_precomp_sketch_data(simple_fqbn, "getversion")
265275

266276
for firmware_version in data["versions"]:
267277
module = data["moduleName"]
@@ -279,7 +289,8 @@ def generate_boards_json(input_data, arduino_cli_path):
279289
boards[fqbn]["name"] = board["name"]
280290
break
281291

282-
boards[fqbn].update(create_upload_data(fqbn, installed_cores))
292+
if fqbn in old_boards:
293+
boards[fqbn].update(create_upload_data(fqbn, installed_cores))
283294

284295
boards_json = []
285296
for _, b in boards.items():

0 commit comments

Comments
 (0)