From e7f9e1f82e767479fbc222f94fec7196880dc4ff Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Tue, 15 Feb 2022 09:14:33 +0200 Subject: [PATCH] Add an autoflash script --- device-under-test/autoflash.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 device-under-test/autoflash.sh diff --git a/device-under-test/autoflash.sh b/device-under-test/autoflash.sh new file mode 100755 index 0000000..ac6b1a3 --- /dev/null +++ b/device-under-test/autoflash.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euo pipefail +shopt -s inherit_errexit + +SERIAL_DEV=/dev/tty.usbserial-310 + +while true; do + echo "Insert device." + if [ -c $SERIAL_DEV ]; then + pio run -e esp32dev -t upload + echo "Done. Remove device." + while [ -c $SERIAL_DEV ] ; do + sleep 1 + done + fi + sleep 1 +done