73 lines
2.0 KiB
Plaintext
73 lines
2.0 KiB
Plaintext
|
|
|
|
|
|
###############################################
|
|
# begin esp-idf stuffss I made ################
|
|
###############################################
|
|
|
|
echo -e "\n=======CUSTOM=======\n"
|
|
|
|
versionData=versionTAG
|
|
commitHash=commitTAG
|
|
installDate=installDateTAG
|
|
|
|
if [ -z $ESPIDF_INSTALLDIR ]; then
|
|
echo -e "\nFAIL: ESPIDF_INSTALLDIR environment variable not found!\nReinstall via script or manually add to ~/.zshrc\n"
|
|
# exit
|
|
fi
|
|
|
|
binDir="$ESPIDF_INSTALLDIR/.custom_bin"
|
|
|
|
echo -e "\nTTY 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 -e "$COUNTER /dev/$line"
|
|
devarr+=("/dev/$line")
|
|
COUNTER=$((COUNTER+1))
|
|
done
|
|
|
|
echo -e "\nEnter TTY Number You'd Like:"
|
|
read tty
|
|
ttyselect=$devarr[(($tty+1))]
|
|
|
|
echo -e "Set esp target:\n\tOne of: esp32, esp32s2, esp32c3, esp32s3, esp32c2, esp32c6, esp32h2, esp32p4, linux, esp32c5, esp32c61, or esp8266"
|
|
read esp
|
|
|
|
# echo -e "\nSetting environment variables\n"
|
|
export PATH="$ESPIDF_INSTALLDIR/.custom_bin:$PATH"
|
|
export ESPPORT=$ttyselect
|
|
export ESPBAUD=460800
|
|
export ESPTARGET=$esp
|
|
|
|
echo -e "Installation Variables:"
|
|
echo -e "\tesp-install-custom version: $versionData"
|
|
echo -e "\tesp-idf commmit hash: $commitHash"
|
|
echo -e "\tinstall date: $installDate\n"
|
|
|
|
echo -e "\nEnvironment Variables:"
|
|
echo -e "\tESPBAUD = $ESPBAUD"
|
|
echo -e "\tESPTARGET = $ESPTARGET"
|
|
echo -e "\tESPPORT = $ESPPORT"
|
|
echo -e "\tESPIDF_INSTALLDIR = $ESPIDF_INSTALLDIR"
|
|
echo -e "\tbinDir = $binDir"
|
|
|
|
# echo -e "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 -e "Changing dir to $ESPIDF_INSTALLDIR"
|
|
# cd $ESPIDF_INSTALLDIR
|
|
|
|
echo -e "\nAll done :3\n"
|
|
|
|
###############################################
|
|
# end esp-idf stuffss I made ##################
|
|
###############################################
|
|
|
|
|