Files
esp-idf-tools/add-to-export-sh.txt
T

59 lines
1.4 KiB
Plaintext

###############################################
# begin esp-idf stuffss I made ################
###############################################
echo "\n=======CUSTOM=======\n"
echo "TTY devices found in dmesg:"
COUNTER=0
devarr=()
for line in $(dmesg | tail -50 | grep -o -E "tty[A-Z]{3}[0-9]{0,2}" | sort -u); do
echo "$COUNTER /dev/$line"
devarr+=("/dev/$line")
COUNTER=$((COUNTER+1))
done
echo "\nEnter TTY Number You'd Like:"
read tty
ttyselect=$devarr[(($tty+1))]
echo "Set esp target (esp32, esp32s3, esp32c6, esp8266, etc)"
read esp
# ESPPORT="${ttyselect}"
echo "Setting environment variables"
echo "Adding Custom bins to PATH"
export PATH="${HOME}/esp/.custom_bin:${PATH}"
echo "ESPPORT = ${ESPPORT}"
export ESPPORT="${ttyselect}"
export ESPBAUD=460800
echo "ESPBAUD = ${ESPBAUD}"
export ESPTARGET=$esp
echo "ESPTARGET = ${ESPTARGET}"
binDir="${HOME}/esp/.custom_bin"
echo "Setting alias"
alias changeport="source ${binDir}/changeport.sh"
alias changebaud="source ${binDir}/changebaud.sh"
alias changeesp="source ${binDir}/changeesp.sh"
alias flash="idf.py flash"
alias monitor="idf.py monitor"
alias erase-flash="idf.py erase-flash"
echo "Changing dir to ${HOME}/esp"
cd "${HOME}/esp"
echo "\nAll done :3\n"
###############################################
# end esp-idf stuffss I made ##################
###############################################