summaryrefslogtreecommitdiff
path: root/docs/reference/pyboard.py.rst
diff options
context:
space:
mode:
authorLars Kellogg-Stedman <lars@oddbit.com>2020-03-25 13:23:01 -0400
committerDamien George <damien.p.george@gmail.com>2020-03-30 11:37:32 +1100
commit1cf994c48b912254802f48e31eaf95e49ac55a82 (patch)
tree4d4ce820ef1ac6463bc9e446bb47578a0cce2deb /docs/reference/pyboard.py.rst
parent688323307a0cb77067a097ffb30077694b0d55d0 (diff)
tools/pyboard.py: Support setting device/baudrate from shell env vars.
Allow defaults for --device and --baudrate to be set in the environment using PYBOARD_DEVICE and PYBOARD_BAUDRATE.
Diffstat (limited to 'docs/reference/pyboard.py.rst')
-rw-r--r--docs/reference/pyboard.py.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/reference/pyboard.py.rst b/docs/reference/pyboard.py.rst
index 60d7509af..d7d6fae3f 100644
--- a/docs/reference/pyboard.py.rst
+++ b/docs/reference/pyboard.py.rst
@@ -59,6 +59,17 @@ with the device.::
$ pyboard.py --device /dev/ttyACM0 -c 'print(1+1)'
2
+If you are often interacting with the same device, you can set the environment
+variable ``PYBOARD_DEVICE`` as an alternative to using the ``--device``
+command line option. For example, the following is equivalent to the previous
+example::
+
+ $ export PYBOARD_DEVICE=/dev/ttyACM0
+ $ pyboard.py -c 'print(1+1)'
+
+Similarly, the ``PYBOARD_BAUDRATE`` environment variable can be used
+to set the default for the `--baudrate` option.
+
Running a script on the device
------------------------------