refactor flashing code

pull/102/head
Jesse Vincent 8 years ago
parent 418309ba11
commit c2d963854e

@ -52,17 +52,20 @@ find_sketch () {
exit 1 exit 1
} }
flash () { prepare_to_flash () {
if [ ! -e "${HEX_FILE_PATH}" ]; then if [ ! -e "${HEX_FILE_PATH}" ]; then
compile compile
fi fi
echo "Press ENTER when ready..." echo "Press ENTER when ready..."
read a read a
}
flash () {
prepare_to_flash
reset_device reset_device
sleep 3s sleep 3s
flash_over_usb() flash_over_usb
} }
@ -71,16 +74,9 @@ flash_over_usb () {
} }
program() {
prepare_to_flash
program () { flash_with_programmer
if [ ! -e "${HEX_FILE_PATH}" ]; then
compile
fi
echo "Press ENTER when ready..."
read a
flash_with_programmer()
} }
flash_with_programmer() { flash_with_programmer() {

Loading…
Cancel
Save