-
Notifications
You must be signed in to change notification settings - Fork 37
/
multicompile.sh
executable file
·42 lines (35 loc) · 1.07 KB
/
multicompile.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
clock_speeds=( 16000000L 8000000L 1000000L )
power_levels=( RF24_PA_MIN RF24_PA_LOW RF24_PA_HIGH RF24_PA_MAX )
mkdir compiled
for f in "${clock_speeds[@]}"
do
for i in {1..110}
do
for p in "${power_levels[@]}"
do
sed -e "s/\${channel}/$i/" -e "s/\${power}/$p/" MYSBootloader.c.original > MYSBootloader.c
if [ $f == "16000000L" ]
then
baudrate="115200"
fi
if [ $f == "8000000L" ]
then
baudrate="57600"
fi
if [ $f == "1000000L" ]
then
baudrate="9600"
fi
echo "Frequency: $f Channel: $i Baud rate: $baudrate Power level: $p"
sed -e "s/\${frequency}/$f/" -e "s/\${baudrate}/$baudrate/" Makefile.original > Makefile
make
if [ `avr-size -B -d MYSBootloader.elf | tail -n 1 | awk '{print $1+$2}'` -le 2048 ]
then
cp MYSBootloader.hex ./compiled/MYSBootloader.ch$i.$f.$p.hex
else
echo "Compiled boot loader is too large to fit in bootloader area!!"
rm --force ./compiled/MYSBootloader.ch$i.$f.$p.hex
fi
done
done
done