#!/usr/bin/env bash

source ./buildroot/bin/buildFunctions;
exitcode=0;

printf "\e[33;1mBuilding mm-avr-usbasp-aetr-A7105-inv-v$MULTI_VERSION.bin\e[0m\n";
opt_disable CHECK_FOR_BOOTLOADER;
opt_disable $ALL_PROTOCOLS;
opt_enable $A7105_PROTOCOLS;
buildMulti;
exitcode=$((exitcode+$?));
mv build/Multiprotocol.ino.bin ./binaries/mm-avr-usbasp-aetr-A7105-inv-v$MULTI_VERSION.bin;

printf "\e[33;1mBuilding mm-avr-usbasp-aetr-CC2500-inv-v$MULTI_VERSION.bin\e[0m\n";
opt_disable $ALL_PROTOCOLS;
opt_enable $CC2500_PROTOCOLS;
opt_disable HITEC_CC2500_INO REDPINE_CC2500_INO OMP_CC2500_INO SKYARTEC_CC2500_INO SCANNER_CC2500_INO FRSKYL_CC2500_INO;
buildMulti;
exitcode=$((exitcode+$?));
mv build/Multiprotocol.ino.bin ./binaries/mm-avr-usbasp-aetr-CC2500-inv-v$MULTI_VERSION.bin;

printf "\e[33;1mBuilding mm-avr-usbasp-aetr-CYRF6936-inv-v$MULTI_VERSION.bin\e[0m\n";
opt_disable $ALL_PROTOCOLS;
opt_enable $CYRF6936_PROTOCOLS;
buildMulti;
exitcode=$((exitcode+$?));
mv build/Multiprotocol.ino.bin ./binaries/mm-avr-usbasp-aetr-CYRF6936-inv-v$MULTI_VERSION.bin;

exit $exitcode;
