From ca4a74a2b5da7a45974e54ecedc7b4f174196ed7 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Mon, 3 Jun 2013 19:23:32 +0200 Subject: [PATCH] cul-update --- CUL/update-cul | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 CUL/update-cul diff --git a/CUL/update-cul b/CUL/update-cul new file mode 100755 index 0000000..bca664e --- /dev/null +++ b/CUL/update-cul @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +if [ "`id -u`" != "0" ]; then + exec sudo "${0}" "${@}" +fi + +if [ "`lsusb -d 03eb:204b`" != "" ]; then + echo "Found running CUL, entering bootloader..." + echo "B01" >/dev/ttyACM0 + sleep 1 +fi + +if [ "`lsusb -d 03eb:2ff4`" != "" ]; then + echo "Found CUL in bootloader-mode" +else + echo "No CUL in bootloader-mode found or unable to enter bootloader mode!" +fi + +echo "Programming..." +set -x +dfu-programmer atmega32u4 erase +dfu-programmer atmega32u4 flash CUL_V3.hex +dfu-programmer atmega32u4 start + -- 2.39.5