You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
KED/ked/run.sh

66 lines
1.4 KiB

#!/bin/bash
CSL_TO_USE=$1
CSL_LIST=$(ls -d -- ./csl)
FILE=build/
clear
if [ -z "$CSL_TO_USE" ];then
echo "Please enter a CSL"
cd csl
echo Curretnly awailable CSL are :
for d in */ ; do #Cheking the directroy to print files
if [ "$d" != "csl/" ];then #Exept csl/
echo -e "\t|--> $d" | grep -oP '.*?(?=\/)' #And remove the finel "/"
fi
done
else
if [ -d "$FILE" ];then
rm -r build
cmake -S . -B build/ -DCSL_USED=$CSL_TO_USE
else
cmake -S . -B build/ -DCSL_USED=$CSL_TO_USE
fi
cd $FILE
make -j4
if [ "$CSL_TO_USE" == "raspberry" ];then
echo -e "\e[36m"
echo "+--------------------------------------+"
echo -e "\tExecuting $CSL_TO_USE"
echo "+--------------------------------------+"
echo -e "\e[32m"
./$CSL_TO_USE
echo -e "\e[36m"
echo "+--------------------------------------+"
echo -e "\tExecution Terminated"
echo "+--------------------------------------+"
echo -e "\e[32m"
fi
if [ "$CSL_TO_USE" == "stm32f042" ];then
echo -e "\e[36m"
echo "+--------------------------------------+"
echo -e "\tFlashing $CSL_TO_USE"
echo "+--------------------------------------+"
echo -e "\e[32m"
st-flash write $CSL_TO_USE.bin 0x08000000
echo -e "\e[36m"
echo "+--------------------------------------+"
echo -e "\tFlashing has Finished"
echo "+--------------------------------------+"
echo -e "\e[32m"
fi
cd ..
fi