Skip to content

Commit

Permalink
Fix the name not being present on the index (#207)
Browse files Browse the repository at this point in the history
Before this we have to have the core installed to retrieve this info.
It's not optimal to install a whole core for a name only
  • Loading branch information
umbynos committed Jul 31, 2023
1 parent 2425c08 commit 61e036b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
26 changes: 13 additions & 13 deletions generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,26 +289,26 @@ def generate_boards_json(input_data, arduino_cli_path, new_boards):
if fqbn in old_boards:
boards[fqbn]["loader_sketch"] = create_precomp_sketch_data(simple_fqbn, "loader")
boards[fqbn]["version_sketch"] = create_precomp_sketch_data(simple_fqbn, "getversion")
boards[fqbn].update(create_upload_data(fqbn, installed_cores))
# Gets the old_board name
res = arduino_cli(
cli_path=arduino_cli_path,
args=["board", "search", fqbn, "--format", "json"],
)
for board in json.loads(res):
if board["fqbn"] == fqbn:
boards[fqbn]["name"] = board["name"]
break

else:
boards[fqbn]["name"] = data["name"]

for firmware_version in data["versions"]:
module = data["moduleName"]
firmware_file = get_firmware_file(module, simple_fqbn, firmware_version)
boards[fqbn]["firmware"].append(create_firmware_data(firmware_file, module, firmware_version))
boards[fqbn]["module"] = module

res = arduino_cli(
cli_path=arduino_cli_path,
args=["board", "search", fqbn, "--format", "json"],
)
# Gets the board name
for board in json.loads(res):
if board["fqbn"] == fqbn:
boards[fqbn]["name"] = board["name"]
break

if fqbn in old_boards:
boards[fqbn].update(create_upload_data(fqbn, installed_cores))

boards_json = []
for _, b in boards.items():
boards_json.append(b)
Expand Down
3 changes: 2 additions & 1 deletion generator/new_boards.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"arduino:renesas_uno:unor4wifi": {
"moduleName": "ESP32-S3",
"versions": ["0.1.0", "0.2.0", "0.2.1"]
"versions": ["0.1.0", "0.2.0", "0.2.1"],
"name": "Arduino UNO R4 WiFi"
}
}

0 comments on commit 61e036b

Please sign in to comment.