summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-05-29 16:35:22 -0700
committerJulian Blake Kongslie2022-05-29 16:35:22 -0700
commit08acaf69dddd69ae4dba9d25de9d3cd72b9bb260 (patch)
tree2a48dc70b0b4365b18276fc20cd694c1ec5c9729 /tool
parentSingle-cycle bypass when there is no contention on memory arbiter. (diff)
downloadmultipdp8-08acaf69dddd69ae4dba9d25de9d3cd72b9bb260.tar.xz
Move stty setup/teardown to separate script; add hconnect script.
Diffstat (limited to '')
-rwxr-xr-xtool/connect31
-rwxr-xr-xtool/hconnect3
-rwxr-xr-xtool/withstty38
3 files changed, 42 insertions, 30 deletions
diff --git a/tool/connect b/tool/connect
index 76ae0e7..3bbd3b7 100755
--- a/tool/connect
+++ b/tool/connect
@@ -1,32 +1,3 @@
1#!/bin/bash 1#!/bin/bash
2 2
3set -eu 3exec tool/withstty con /dev/ttyUSB0
4
5OLD_SETTINGS="$(stty -g -F /dev/ttyUSB0)"
6
7stty -F /dev/ttyUSB0 \
8 1000000 \
9 -drain \
10 -clocal \
11 cread \
12 crtscts \
13 cs8 \
14 cstopb \
15 -hup \
16 parenb \
17 parodd \
18 -cmspar \
19 -igncr \
20 ignpar \
21 -parmrk \
22 inpck \
23 -istrip \
24 -ixany \
25 -ixoff \
26 -ixon \
27 -echo \
28 -icanon
29
30con /dev/ttyUSB0 || true
31
32stty -drain "$OLD_SETTINGS" -F /dev/ttyUSB0 2> /dev/null
diff --git a/tool/hconnect b/tool/hconnect
new file mode 100755
index 0000000..7c823c7
--- /dev/null
+++ b/tool/hconnect
@@ -0,0 +1,3 @@
1#!/bin/bash
2
3exec tool/withstty hcon /dev/ttyUSB0
diff --git a/tool/withstty b/tool/withstty
new file mode 100755
index 0000000..9f23565
--- /dev/null
+++ b/tool/withstty
@@ -0,0 +1,38 @@
1#!/bin/bash
2
3set -eu
4
5OLD_SETTINGS="$(stty -g -F /dev/ttyUSB0)"
6
7stty -F /dev/ttyUSB0 \
8 1000000 \
9 -drain \
10 -clocal \
11 cread \
12 crtscts \
13 cs8 \
14 cstopb \
15 -hup \
16 parenb \
17 parodd \
18 -cmspar \
19 -igncr \
20 ignpar \
21 -parmrk \
22 inpck \
23 -istrip \
24 -ixany \
25 -ixoff \
26 -ixon \
27 -echo \
28 -icanon \
29 -onlcr
30
31set +e
32"$@"
33ERROR="$?"
34set -e
35
36stty -drain "$OLD_SETTINGS" -F /dev/ttyUSB0 2> /dev/null
37
38exit "$ERROR"