aboutsummaryrefslogtreecommitdiff
path: root/lib/vusb/examples/hid-mouse/make-files.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vusb/examples/hid-mouse/make-files.sh')
-rwxr-xr-xlib/vusb/examples/hid-mouse/make-files.sh38
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
9if [ "$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
15fi
16
17cat << \EOF | sed -n -f /dev/stdin ../../usbdrv/usbconfig-prototype.h >firmware/usbconfig.h
18/^\( [*] \)\{0,1\}[+].*$/ d
19s/^#define USB_CFG_DMINUS_BIT .*$/#define USB_CFG_DMINUS_BIT 4/g
20s|^.*#define USB_CFG_CLOCK_KHZ.*$|#define USB_CFG_CLOCK_KHZ (F_CPU/1000)|g
21s/^#define USB_CFG_HAVE_INTRIN_ENDPOINT .*$/#define USB_CFG_HAVE_INTRIN_ENDPOINT 1/g
22s|^#define USB_CFG_DEVICE_ID .*$|#define USB_CFG_DEVICE_ID 0xe8, 0x03 /* VOTI's lab use PID */|g
23s/^#define USB_CFG_DEVICE_NAME .*$/#define USB_CFG_DEVICE_NAME 'M', 'o', 'u', 's', 'e'/g
24s/^#define USB_CFG_DEVICE_NAME_LEN .*$/#define USB_CFG_DEVICE_NAME_LEN 5/g
25
26s/^#define USB_CFG_INTR_POLL_INTERVAL .*$/#define USB_CFG_INTR_POLL_INTERVAL 100/g
27s/^#define USB_CFG_MAX_BUS_POWER .*$/#define USB_CFG_MAX_BUS_POWER 20/g
28s/^#define USB_CFG_DEVICE_CLASS .*$/#define USB_CFG_DEVICE_CLASS 0/g
29s/^#define USB_CFG_INTERFACE_CLASS .*$/#define USB_CFG_INTERFACE_CLASS 3/g
30s/^.*#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH.*$/#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 52/g
31p
32EOF
33
34cat << \EOF | sed -n -f /dev/stdin ../custom-class/firmware/Makefile >firmware/Makefile
35/^\( [*] \)\{0,1\}[+].*$/ d
36s/^# Project: .*$/# Project: hid-mouse example/g
37p
38EOF