Procházet zdrojové kódy

fix GUI contract nesting and startup path

高宇轩 před 3 měsíci
rodič
revize
0e87d963fa

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
generated/6400/manual-uart-contract.json


+ 4 - 2
tools/6400_hex_gui.py

@@ -31,6 +31,8 @@ try:
 except FileNotFoundError:
     METADATA = {"profile": "source", "commit": "WORKTREE", "bitstream_sha256": "NOT_BUILT"}
 WIRE = CONTRACT["wire"]
+UART_WIRE = WIRE.get("uart", WIRE)
+I2C_WIRE = WIRE.get("host_i2c", {})
 COMMANDS = WIRE["commands"]
 RESPONSES = WIRE["responses"]
 STATUS = {int(value): name for name, value in RESPONSES["ACK_NACK"]["status"].items()}
@@ -123,8 +125,8 @@ def run_gui() -> int:
         ("Profile", profile), ("CPLD commit", METADATA["commit"]),
         ("Contract SHA", CONTRACT["contract_sha256"]),
         ("Bitstream SHA", METADATA["bitstream_sha256"]),
-        ("Host UART", f"{CONTRACT['wire']['uart']['baud']} {CONTRACT['wire']['uart']['format']}"),
-        ("Host I2C", f"0x{CONTRACT['wire']['host_i2c']['address_7bit']:02X} / 16-bit / CON36"),
+        ("Host UART", f"{UART_WIRE['baud']} {UART_WIRE['format']}"),
+        ("Host I2C", f"0x{int(I2C_WIRE['address_7bit']):02X} / 16-bit / CON36"),
         ("PTC PWM", f"{CONTRACT['outputs']['ptc_pwm_hz']} Hz"),
         ("FAN PWM", f"{CONTRACT['outputs']['fan_pwm_hz']} Hz"),
         ("SET_ALL watchdog", f"{CONTRACT['watchdog']['seconds']} s"),

+ 1 - 1
tools/generate_6400_manual.py

@@ -175,7 +175,7 @@ def generate() -> dict[Path, bytes]:
       "product": manual["product"],
       "board": manual["board"],
       "wire": {
-        **manual["uart"],
+        "uart": manual["uart"],
         "host_i2c": manual["host_i2c"],
         "commands": wire["commands"],
         "responses": wire["responses"],