Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/embeddedci-mcp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
`analog_path`, `adc_read` and `capture_adc` take `range`; `calibrate_adc_gain` takes `range=low`
for the low range's gain. `adc_read` reports `range`, `fullscale` and `overrange`, `capture_adc`
`range` and `clipped_samples`, `calibration` `adc_low_gain_ppm`.
- `set_wiring` takes back what `wiring` returned: the server's `loop_output_*` keys pass through
like `loop_input_*`, so reading the profile, changing a value and saving it works and keeps them.
- Requires embeddedci 2.13.4.

## 2.13.3
Expand Down
11 changes: 11 additions & 0 deletions packages/embeddedci-mcp/tests/test_wiring_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,14 @@ def test_signals_reach_gpio_and_trigger_arguments(connected):
assert call("gpio_mode", la=["TRIGGER"])["pins"][0]["la"] == 9
assert call("capture_la", samples=64, sample_rate_hz=1e6,
trigger_la="TRIGGER")["trigger"] == "LA9 rising"


def test_set_wiring_takes_back_what_wiring_returned(connected):
# The server keeps loop_input_* and loop_output_* in the profile: an agent that reads the
# profile, changes one value and writes it back must not be refused, or lose them.
stored = {"swd_target": "", "loop_input_unit": "mA", "loop_output_enabled": True, "loop_output_max_v": 3.3}
SESSION.require().wiring = Wiring.from_dict(stored, strict=False)
profile = call("wiring")["profile"]
result = call("set_wiring", profile={**profile, "swd_target": "target/stm32f4x.cfg"})
assert result["swd_target"] == "target/stm32f4x.cfg"
assert SESSION.require().wiring.extra["loop_output_max_v"] == 3.3
2 changes: 1 addition & 1 deletion packages/embeddedci/src/embeddedci/benchpod/wiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
_NAME = re.compile(r"^[A-Za-z][A-Za-z0-9_]{0,31}$")
_SIGNAL_KEYS = ("name", "la", "direction", "active_low", "description")
#: Keys other parts of the product keep in the profile; the SDK passes them through untouched.
_PASSTHROUGH_PREFIXES = ("loop_input_",)
_PASSTHROUGH_PREFIXES = ("loop_input_", "loop_output_")


def _is_int(value: Any) -> bool:
Expand Down