Files
esp-idf-tools/custom_bin/changebaud.sh
T
2025-05-09 15:27:57 -06:00

42 lines
955 B
Bash

subprocess() {
echo -e "\nChanging ESPBAUD\n\t1: 9600\n\t2: 115200\n\t3: 230400\n\t4: 460800\n\t5: 1152000\n\t6: 1500000\n\nEnter Selection: "
read baudRate
echo -e "\n"
case $baudRate in
1) selection=9600;;
2) selection=115200;;
3) selection=230400;;
4) selection=460800;;
5) selection=1152000;;
6) selection=1500000;;
esac
echo $selection
}
function selectBaud() {
echo -e "\nChanging ESPBAUD\n\t1: 9600\n\t2: 115200\n\t3: 230400\n\t4: 460800\n\t5: 1152000\n\t6: 1500000\n\nEnter Selection: "
read baudRate
echo -e "\n"
case $baudRate in
1) selection=9600;;
2) selection=115200;;
3) selection=230400;;
4) selection=460800;;
5) selection=1152000;;
6) selection=1500000;;
esac
echo $selection
}
if [ ! -z $1 ]; then
ret="$1"
else
ret=$(selectBaud)
fi
echo "ret: $ret"
export ESPBAUD=$ret
echo "\nBaudrate set to $ESPBAUD\n"
echo "\nAll done :3\n"