-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathupload
executable file
·36 lines (32 loc) · 1.04 KB
/
upload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
# Name:
# By Robbert Gurdeep Singh
# --pref build.path=/tmp/build
# The above extra arguments allows specifying a build loc
################################################################################
set -x -e
device="$(echo "${1?-Please specify a device type}" | tr '[:lower:]' '[:upper:]')"
file=${2?-No file to upload}
shift 2
if [ -n "$USE_TMPDIR" ]; then
tmpfile="$(mktemp -d --tmpdir)"
trap "rm -rf '$tmpfile'" EXIT
cp "$file" "$tmpfile/prog.c"
cd "$tmpfile"
file="prog.c"
fi
case "$device" in
"ESP32")
exec arduino --upload "$file" --board "esp32:esp32:esp32doit-devkit-v1:FlashFreq=80,UploadSpeed=921600,DebugLevel=none" "$@"
;;
"ESP32WROVER")
exec arduino --upload "$file" --board "esp32:esp32:esp32wrover:FlashFreq=80,UploadSpeed=921600,DebugLevel=none" "$@"
;;
"ESP8266")
exec arduino --upload "$file" --board "esp8266:esp8266:nodemcu:xtal=80,vt=flash,exception=disabled,ssl=all,eesz=4M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=all,baud=115200" "$@"
;;
*)
echo "Unknown device: $device"
exit 1
esac
echo "done"