# CTR2-MICRO Programmer for Linux and Mac.  Should also work on MSWindows
# MUST have python3 and pip installed
# Lou Scalpati KI5FTY

PYTHON=python3
CHIP=esp32c3

#-----------------------------------------------
# Replace the PORT and DIR variables below to fit your system
#-----------------------------------------------
# Begin Edit

PORT=/dev/<YOUR-USB-DEVICE>
DIR=<DIRECTORY-CONTAINING-CTR2-MICRO.BIN FILE>


# End Edit
#------------------------------------------------

pip -q install esptool

read -rsn1 -p "Hold down ENCODER and press any key to continue" 

$PYTHON -m esptool --chip $CHIP --port $PORT  write_flash -z 0x0 $DIR/CTR2-Micro.bin
