diff options
Diffstat (limited to 'lib/vusb/examples/hid-mouse/make-files.sh')
-rwxr-xr-x | lib/vusb/examples/hid-mouse/make-files.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/vusb/examples/hid-mouse/make-files.sh b/lib/vusb/examples/hid-mouse/make-files.sh new file mode 100755 index 000000000..3e931c4ee --- /dev/null +++ b/lib/vusb/examples/hid-mouse/make-files.sh | |||
@@ -0,0 +1,38 @@ | |||
1 | #!/bin/sh | ||
2 | # Author: Christian Starkjohann | ||
3 | # Creation Date: 2008-04-17 | ||
4 | # Tabsize: 4 | ||
5 | # Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH | ||
6 | # License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) | ||
7 | |||
8 | |||
9 | if [ "$1" = remove ]; then | ||
10 | (cd firmware; make clean) | ||
11 | rm -f firmware/usbconfig.h | ||
12 | rm -rf firmware/usbdrv | ||
13 | rm -f firmware/Makefile | ||
14 | exit | ||
15 | fi | ||
16 | |||
17 | cat << \EOF | sed -n -f /dev/stdin ../../usbdrv/usbconfig-prototype.h >firmware/usbconfig.h | ||
18 | /^\( [*] \)\{0,1\}[+].*$/ d | ||
19 | s/^#define USB_CFG_DMINUS_BIT .*$/#define USB_CFG_DMINUS_BIT 4/g | ||
20 | s|^.*#define USB_CFG_CLOCK_KHZ.*$|#define USB_CFG_CLOCK_KHZ (F_CPU/1000)|g | ||
21 | s/^#define USB_CFG_HAVE_INTRIN_ENDPOINT .*$/#define USB_CFG_HAVE_INTRIN_ENDPOINT 1/g | ||
22 | s|^#define USB_CFG_DEVICE_ID .*$|#define USB_CFG_DEVICE_ID 0xe8, 0x03 /* VOTI's lab use PID */|g | ||
23 | s/^#define USB_CFG_DEVICE_NAME .*$/#define USB_CFG_DEVICE_NAME 'M', 'o', 'u', 's', 'e'/g | ||
24 | s/^#define USB_CFG_DEVICE_NAME_LEN .*$/#define USB_CFG_DEVICE_NAME_LEN 5/g | ||
25 | |||
26 | s/^#define USB_CFG_INTR_POLL_INTERVAL .*$/#define USB_CFG_INTR_POLL_INTERVAL 100/g | ||
27 | s/^#define USB_CFG_MAX_BUS_POWER .*$/#define USB_CFG_MAX_BUS_POWER 20/g | ||
28 | s/^#define USB_CFG_DEVICE_CLASS .*$/#define USB_CFG_DEVICE_CLASS 0/g | ||
29 | s/^#define USB_CFG_INTERFACE_CLASS .*$/#define USB_CFG_INTERFACE_CLASS 3/g | ||
30 | s/^.*#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH.*$/#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 52/g | ||
31 | p | ||
32 | EOF | ||
33 | |||
34 | cat << \EOF | sed -n -f /dev/stdin ../custom-class/firmware/Makefile >firmware/Makefile | ||
35 | /^\( [*] \)\{0,1\}[+].*$/ d | ||
36 | s/^# Project: .*$/# Project: hid-mouse example/g | ||
37 | p | ||
38 | EOF | ||