#!/bin/bash
cd ..
bindir=FactoryTest/build/esp32.esp32.m5stack_stickc_plus
mkdir -p "$bindir"
baseurl="https://cit.istlab.info/f/plus1/FactoryTest.ino."
echo "Downloading FactoryTest for PLUS1 firmware files..."
for ext in bin bootloader.bin partitions.bin; do
url="${baseurl}${ext}"
echo "Downloading $url ..."
curl -L -o "$bindir/FactoryTest.ino.${ext}" "$url"
if [ $? -ne 0 ]; then
echo "Failed to download $url"
exit 1
fi
done
ls -ltr $bindir