Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6392af08ed4d
Choose a base ref
...
head repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: aca359701e70
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Aug 6, 2019

  1. Copy the full SHA
    aca3597 View commit details
Showing with 10 additions and 0 deletions.
  1. +10 −0 software/glasgow/cli.py
10 changes: 10 additions & 0 deletions software/glasgow/cli.py
Original file line number Diff line number Diff line change
@@ -182,6 +182,10 @@ def add_voltage_arg(parser, help):
"--no-alert", dest="set_alert", default=True, action="store_false",
help="do not raise an alert if Vsense is out of range of Vio")

p_safe = subparsers.add_parser(
"safe", formatter_class=TextHelpFormatter,
help="turn off all I/O port voltage regulators and drivers")

p_voltage_limit = subparsers.add_parser(
"voltage-limit", formatter_class=TextHelpFormatter,
help="limit I/O port voltage as a safety mechanism")
@@ -436,6 +440,12 @@ async def _main():
print("{}\t{:.2}\t{:.2}\t{:.3}\t{:.2}-{:.2}\t{}"
.format(port, vio, vlimit, vsense, alert[0], alert[1], notice))

if args.action == "safe":
await device.reset_alert("AB")
await device.set_voltage("AB", 0.0)
await device.poll_alert() # clear any remaining alerts
logger.info("all ports safe")

if args.action == "voltage-limit":
if args.voltage is not None:
await device.set_voltage_limit(args.ports, args.voltage)