From 74973624deed05d1cc8b297fb1d877cadad50969 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Thu, 2 Aug 2018 17:21:14 +0200 Subject: new commit-history root - cleaned off passwords --- scripts/make.inc.sh | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 scripts/make.inc.sh (limited to 'scripts/make.inc.sh') diff --git a/scripts/make.inc.sh b/scripts/make.inc.sh new file mode 100644 index 0000000..598e306 --- /dev/null +++ b/scripts/make.inc.sh @@ -0,0 +1,58 @@ +# intended to be included from shell-script + +PORT=${PORT:-/dev/ttyUSB0} +_PROJECT_DIR=${0%/*} +_SCRIPTS_DIR=${0%/*}/../scripts + +if test -z "$PY_SOURCES"; then + echo "PY_SOURCES variable must be set" + exit 1 +fi + +testport() { + if test -c $PORT; then + true + else + echo "$PORT not connected" >&2 + exit 1 + fi +} + +case "$1" in + console) + testport + screen $PORT 115200 + ;; + flash) + testport + $_SCRIPTS_DIR/flash.sh "${PORT}" + ;; + setup) + testport + $_SCRIPTS_DIR/setup_wlan.sh "${PORT}" "${_PROJECT_DIR}/.config" + ;; + copy) + testport + for file in $PY_SOURCES; do + $_SCRIPTS_DIR/transfer.sh "${PORT}" "${_PROJECT_DIR}/$file" "$file" + done + ;; + format) + testport + $_SCRIPTS_DIR/format.sh "${PORT}" + ;; + reset) + testport + echo -e -n "\003\004" > "${PORT}" + sleep 3 + ;; + config) + export srctree="${_PROJECT_DIR}" + export KCONFIG_CONFIG="${_PROJECT_DIR}/.config" + python3 "$_SCRIPTS_DIR/menuconfig.py" "${_PROJECT_DIR}/Kconfig" + ;; + *) + echo "Command '$1' not supported" >&2 + exit 1 + ;; +esac -- cgit v1.2.1