Merge remote-tracking branch 'root/master' into mqtt

pull/783/head
Kevin Hester 2021-04-10 12:02:05 +08:00
commit 63a10b9bf8
2 zmienionych plików z 14 dodań i 4 usunięć

Wyświetl plik

@ -1,13 +1,13 @@
#!/bin/sh
PYTHON=${PYTHON:-python3}
PYTHON=${PYTHON:-$(which python3 python|head -n 1)}
set -e
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME]
Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME]
Flash image file to device, but first erasing and writing system information"
-h Display this help and exit
@ -39,6 +39,11 @@ while getopts ":hp:P:f:" opt; do
done
shift "$((OPTIND-1))"
[ -z "$FILENAME" -a -n "$1" ] && {
FILENAME=$1
shift
}
if [ -f "${FILENAME}" ]; then
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
$PYTHON -m esptool --baud 921600 erase_flash

Wyświetl plik

@ -1,11 +1,11 @@
#!/bin/sh
PYTHON=${PYTHON:-python3}
PYTHON=${PYTHON:-$(which python3 python|head -n 1)}
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} [-h] [-p ESPTOOL_PORT] [-P PYTHON] -f FILENAME
Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME]
Flash image file to device, leave existing system intact."
-h Display this help and exit
@ -37,6 +37,11 @@ while getopts ":hp:P:f:" opt; do
done
shift "$((OPTIND-1))"
[ -z "$FILENAME" -a -n "$1" ] && {
FILENAME=$1
shift
}
if [ -f "${FILENAME}" ]; then
echo "Trying to flash update ${FILENAME}."
$PYTHON -m esptool --baud 921600 write_flash 0x10000 ${FILENAME}