MP3 comes in chunks of encoded data started by a header sequence. Scan for it in the decoder and only pass in data that starts with this header to avoid the burst errors Avoids a avalanche of `lost synchronization` error reports when there is a file error. Also enable additional sketches on the RP2040/RP2350
34 lines
852 B
Bash
Executable File
34 lines
852 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
set -o pipefail
|
|
|
|
outdir=$1; shift
|
|
offset=$1; shift
|
|
fqbn=$1; shift
|
|
|
|
mkdir $outdir
|
|
rm -f *.elf
|
|
|
|
# Get initial list and shift off to the starting point
|
|
sketches=$(find ~/Arduino/libraries/ESP8266Audio/examples -name "*.ino" | sort | tr '\n' ' ' | cut -f$offset -d " ")
|
|
|
|
# Iterate over sketches
|
|
while [ $(echo $sketches | wc -w) -gt 0 ]; do
|
|
sketch=$(echo $sketches | cut -f1 -d " ")
|
|
echo "::group::Compiling $(basename $sketch) for $fqbn into $outdir"
|
|
./arduino-cli compile -b "$fqbn" -v --warnings all --build-path "$outdir" "$sketch" || exit 255
|
|
mv -f "$outdir"/*.elf .
|
|
echo "::endgroup::"
|
|
# Shift out 5
|
|
if [ $(echo $sketches | wc -w) -gt 5 ]; then
|
|
sketches=$(echo $sketches | cut -f6- -d " ")
|
|
else
|
|
sketches=""
|
|
fi
|
|
done
|
|
|
|
echo "::group::Final Sizes"
|
|
size ./*.elf
|
|
echo "::endgroup::"
|