diff options
| author | Julian Blake Kongslie | 2022-05-29 16:35:22 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-05-29 16:35:22 -0700 |
| commit | 08acaf69dddd69ae4dba9d25de9d3cd72b9bb260 (patch) | |
| tree | 2a48dc70b0b4365b18276fc20cd694c1ec5c9729 | |
| parent | Single-cycle bypass when there is no contention on memory arbiter. (diff) | |
| download | multipdp8-08acaf69dddd69ae4dba9d25de9d3cd72b9bb260.tar.xz | |
Move stty setup/teardown to separate script; add hconnect script.
| -rwxr-xr-x | tool/connect | 31 | ||||
| -rwxr-xr-x | tool/hconnect | 3 | ||||
| -rwxr-xr-x | tool/withstty | 38 |
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 | ||
| 3 | set -eu | 3 | exec tool/withstty con /dev/ttyUSB0 |
| 4 | |||
| 5 | OLD_SETTINGS="$(stty -g -F /dev/ttyUSB0)" | ||
| 6 | |||
| 7 | stty -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 | |||
| 30 | con /dev/ttyUSB0 || true | ||
| 31 | |||
| 32 | stty -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 | |||
| 3 | exec 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 | |||
| 3 | set -eu | ||
| 4 | |||
| 5 | OLD_SETTINGS="$(stty -g -F /dev/ttyUSB0)" | ||
| 6 | |||
| 7 | stty -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 | |||
| 31 | set +e | ||
| 32 | "$@" | ||
| 33 | ERROR="$?" | ||
| 34 | set -e | ||
| 35 | |||
| 36 | stty -drain "$OLD_SETTINGS" -F /dev/ttyUSB0 2> /dev/null | ||
| 37 | |||
| 38 | exit "$ERROR" | ||
