From: Michael Gernoth Date: Mon, 3 Jun 2013 17:23:32 +0000 (+0200) Subject: cul-update X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/fhem-stuff/commitdiff_plain/ca4a74a2b5da7a45974e54ecedc7b4f174196ed7?ds=inline cul-update --- 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 +