Add scripts for using ch341a programmer

This commit is contained in:
Jeremy Soller
2020-06-29 10:55:22 -06:00
parent c2a84550eb
commit b0d4fd3487
3 changed files with 47 additions and 0 deletions

15
scripts/_ch341a.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
if [ ! -d "models/${MODEL}" ]
then
echo "model '${MODEL}' not found" >&2
exit 1
fi
MODEL_DIR="$(realpath "models/${MODEL}")"
if [ ! -f "${MODEL_DIR}/chip.txt" ]
then
echo "model '${MODEL}' does not have chip.txt" >&2
exit 1
fi
CHIP="$(cat "${MODEL_DIR}/chip.txt")"