fix: analog designs always get 6 pins connected

instead, we should read the `analog_pins` setting from the project's info.yaml
This commit is contained in:
Uri Shaked
2024-05-29 13:19:29 +03:00
parent f56fdf7cbe
commit 74796c81c7
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -91,6 +91,17 @@ class ProjectInfo:
)
self.tiles: str = tiles
analog_pins = project_section.get("analog_pins", 0)
if not isinstance(analog_pins, int):
raise ProjectYamlError(
"Invalid value for 'analog_pins' in 'project' section, must be an integer"
)
if analog_pins < 0 or analog_pins > 6:
raise ProjectYamlError(
"Invalid value for 'analog_pins' in 'project' section, must be between 0 and 6"
)
self.analog_pins: int = analog_pins
language = project_section.get("language")
if language is None:
raise ProjectYamlError("Missing key 'language' in 'project' section")
+1 -1
View File
@@ -76,7 +76,7 @@ class ShuttleConfig:
"name": project.unprefixed_name,
"width": width,
"height": height,
"analog": {i: None for i in range(len(project.info.pinout.ua))},
"analog": {i: None for i in range(project.info.analog_pins)},
}
module_config["modules"].append(module_entry)