1746846606

This commit is contained in:
2025-05-09 21:10:06 -06:00
parent 87e43a5f43
commit 2c56898923
8 changed files with 62 additions and 28 deletions
+23 -23
View File
@@ -1,28 +1,28 @@
#!/bin/bash
function 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
# function subprocess() {
# targets=$(idf.py --list-targets)
# out=''
#
# for target in $targets; do
# out="$out $target"
# done
#
# eval "$1=$out"
#
# return 0
# }
eval "$1=$selection"
return 0
function getTargets() {
tmpFile='/tmp/targets.tmp'
idf.py --list-targets > "$tmpFile"
tr '\n' ' ' < "$tmpFile"
rm "$tmpFile"
}
if [ ! -z "$1" ]; then
ret="$1"
else
ret=''
subprocess ret
fi
targs=$(getTargets)
export ESPBAUD=$ret
echo -e "\nBaudrate set to $ESPBAUD\n"
echo -e "\nAll done :3\n"
echo $targs
# ret=''
# subprocess ret
# echo "$ret"