-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·29 lines (25 loc) · 992 Bytes
/
deploy.sh
File metadata and controls
executable file
·29 lines (25 loc) · 992 Bytes
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
#!/bin/bash
BUILD_PATH="$ANESIDORA_PATH/build"
UF2="$BUILD_PATH/anesidora.uf2"
ELF="$BUILD_PATH/anesidora.elf"
CHIP="rp2040"
# Loop through all arguments
for arg in "$@"; do
if [ "$arg" == "-b" ] || [ "$arg" == "--build" ]; then
cmake -S $ANESIDORA_PATH -B $BUILD_PATH && cd $BUILD_PATH && make;
# -DCMAKE_BUILD_TYPE=Debug
# -G Ninja
fi
if [ "$arg" == "-f" ] || [ "$arg" == "--flash" ]; then
if test -d $PICO_USB_DISK_PATH; then
echo "COPYING UF2 to pi pico" && cp $UF2 $PICO_USB_DISK_PATH;
else
echo -e "\e[31mERROR: pico unmounted or unmounted as a mass storage device.\e[0m"
fi
fi
if [ "$arg" == "-d" ] || [ "$arg" == "--debug" ]; then
cd $BUILD_PATH && make -j4
openocd -f interface/cmsis-dap.cfg -f target/$CHIP.cfg -c "adapter speed 5000" -c "program $ELF verify reset exit"
openocd -f interface/cmsis-dap.cfg -f target/$CHIP.cfg -c "adapter speed 5000"
fi
done