diff options
Diffstat (limited to 'tools/detect_lufa_cdc')
-rwxr-xr-x | tools/detect_lufa_cdc | 9 |
1 files changed, 9 insertions, 0 deletions
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 |