mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
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:
@@ -91,6 +91,17 @@ class ProjectInfo:
|
|||||||
)
|
)
|
||||||
self.tiles: str = tiles
|
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")
|
language = project_section.get("language")
|
||||||
if language is None:
|
if language is None:
|
||||||
raise ProjectYamlError("Missing key 'language' in 'project' section")
|
raise ProjectYamlError("Missing key 'language' in 'project' section")
|
||||||
|
|||||||
+1
-1
@@ -76,7 +76,7 @@ class ShuttleConfig:
|
|||||||
"name": project.unprefixed_name,
|
"name": project.unprefixed_name,
|
||||||
"width": width,
|
"width": width,
|
||||||
"height": height,
|
"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)
|
module_config["modules"].append(module_entry)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user