Browse Source

Makefile 'restart' target

Useful for some tests...
pull/5/head
Raphael Assenat 5 years ago
parent
commit
158d9bffda
2 changed files with 25 additions and 0 deletions
  1. +4
    -0
      Makefile
  2. +21
    -0
      scripts/start.sh

+ 4
- 0
Makefile View File

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

+ 21
- 0
scripts/start.sh 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

Loading…
Cancel
Save