Makefile 'restart' target

Useful for some tests...
This commit is contained in:
Raphael Assenat 2017-01-08 16:18:34 -05:00
parent c7e8dc7ad4
commit 158d9bffda
2 changed files with 25 additions and 0 deletions

View File

@ -58,3 +58,7 @@ chip_erase:
reset:
dfu-programmer atmega32u2 reset
restart:
- ./scripts/enter_bootloader.sh
./scripts/start.sh $(CPU)

21
scripts/start.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Syntax: ./start.sh CPU"
exit 1;
fi
CPU=$1
echo "Polling for chip..."
while true; do
dfu-programmer $1 start
if [ $? -eq 0 ]; then
echo "Chip found. Started."
break;
fi
sleep 1
done