run-in-simulavr.sh: terminate simulation if stop recieved.
Note by Traumflug: this
while read -r LINE; do
some commands
done << (some other command)
didn't work here (bash 4.3.11 on Ubuntu 14.04), so I had to swap
the sequence of these two commands for using a pipe. Anyways,
excellent idea, shortens some simulator runs drastically!
This commit is contained in:
parent
fa0e0d37e7
commit
0723b53c44
|
|
@ -84,11 +84,18 @@ for GCODE_FILE in $*; do
|
||||||
|
|
||||||
# We assume here queue and rx buffer are large enough to read
|
# We assume here queue and rx buffer are large enough to read
|
||||||
# the file in one chunk. If not, raise MOVEBUFFER_SIZE in config.h.
|
# the file in one chunk. If not, raise MOVEBUFFER_SIZE in config.h.
|
||||||
set -x
|
|
||||||
"${SIMULAVR}" -c vcd:${TRACEIN_FILE}:"${VCD_FILE}" \
|
"${SIMULAVR}" -c vcd:${TRACEIN_FILE}:"${VCD_FILE}" \
|
||||||
-f ../build/teacup.elf \
|
-f ../build/teacup.elf \
|
||||||
-m 60000000000 -v < "${GCODE_FILE}"
|
-m 60000000000 -v < "${GCODE_FILE}" | \
|
||||||
set +x
|
while read -r LINE; do
|
||||||
|
echo "${LINE}"
|
||||||
|
case "${LINE}" in
|
||||||
|
stop)
|
||||||
|
echo "Got \"stop\", killing ${SIMULAVR}."
|
||||||
|
kill -INT $(pidof -x "${SIMULAVR}")
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# Make plottable files from VCD files.
|
# Make plottable files from VCD files.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue