From 585e0bcb012a6008af7d4a5ce6c694f78b936092 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Sun, 12 Jun 2016 06:37:30 +0200 Subject: better lufa detect and reset --- tools/detect_lufa_cdc | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 tools/detect_lufa_cdc (limited to 'tools/detect_lufa_cdc') diff --git a/tools/detect_lufa_cdc b/tools/detect_lufa_cdc new file mode 100755 index 0000000..2308ceb --- /dev/null +++ b/tools/detect_lufa_cdc @@ -0,0 +1,9 @@ +#!/bin/zsh +#(c) Bernhard Tittelbach + +LUFA_USB_SYSFS=( /sys/bus/usb/devices/*/idVendor(e:'grep -q 03eb $REPLY'::h) ) +LUFA_CDC_DEVS=( ${^LUFA_USB_SYSFS}/*/tty/ttyACM*(:t) ) + +[[ -n $1 ]] && print /dev/${LUFA_CDC_DEVS[$1]} || print /dev/${^LUFA_CDC_DEVS} + +exit 0 -- cgit v1.2.3