Files
esp-idf-tools/add-to-export-sh.txt
T
2024-11-12 07:39:50 -07:00

62 lines
1.6 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:\n\tOne of: esp32, esp32s2, esp32c3, esp32s3, esp32c2, esp32c6, esp32h2, esp32p4, linux, esp32c5, or esp32c61"
read esp
echo "Setting environment variables"
echo "Adding Custom bins to PATH"
export PATH="${ESPIDF_INSTALLDIR}/.custom_bin:${PATH}"
echo "ESPPORT = ${ESPPORT}"
export ESPPORT="${ttyselect}"
export ESPBAUD=460800
echo "ESPBAUD = ${ESPBAUD}"
export ESPTARGET=$esp
echo "ESPTARGET = ${ESPTARGET}"
echo "ESPIDF_INSTALLDR=${ESPIDF_INSTALLDIR}"
binDir="${ESPIDF_INSTALLDIR}/.custom_bin"
echo "binDir=${binDir}"
echo "Setting alias"
alias changeport="source ${binDir}/changeport.sh"
alias changebaud="source ${binDir}/changebaud.sh"
alias changeesp="source ${binDir}/changeesp.sh"
alias monitor="idf.py monitor"
alias flashmonitor="idf.py flash monitor"
alias menuconfig="idf.py menuconfig"
echo "Changing dir to ${ESPIDF_INSTALLDIR}"
cd "${ESPIDF_INSTALLDIR}"
echo "\nAll done :3\n"
###############################################
# end esp-idf stuffss I made ##################
###############################################