diff options
| author | Florian Jung <flo@windfisch.org> | 2014-04-05 19:45:53 +0200 | 
|---|---|---|
| committer | Florian Jung <flo@windfisch.org> | 2014-04-05 19:45:53 +0200 | 
| commit | 7d57cc8a33015602e5a867978a79fc7fce25402a (patch) | |
| tree | 6371571c394d1348722d7f4681cd8120c350e1d7 | |
| parent | 8e80709d69076574b002c9d1e1a235e19ac0d22e (diff) | |
do not advertise unused buttons
| -rw-r--r-- | main.c | 9 | ||||
| -rw-r--r-- | usbdrv/usbconfig.h | 2 | 
2 files changed, 7 insertions, 4 deletions
@@ -51,19 +51,22 @@  static char buffer[300]; // contains the exploded gamecube bits, i.e. each bit sent/received occupies one byte here. -PROGMEM const char usbHidReportDescriptor[50] = { +PROGMEM const char usbHidReportDescriptor[56] = {      0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)      0x09, 0x05,                    // USAGE (Game Pad)      0xA1, 0x01,                    // COLLECTION (Application)      0xA1, 0x00,                    //   COLLECTION (Physical)      0x05, 0x09,                    //     USAGE_PAGE (Button)      0x19, 0x01,                    //     USAGE_MINIMUM (Button 1) -    0x29, 0x10,                    //     USAGE_MAXIMUM (Button 16) +    0x29, 0x0C,                    //     USAGE_MAXIMUM (Button 12)      0x15, 0x00,                    //     LOGICAL_MINIMUM (0)      0x25, 0x01,                    //     LOGICAL_MAXIMUM (1) -    0x95, 0x10,                    //     REPORT_COUNT (16) +    0x95, 0x0C,                    //     REPORT_COUNT (12)      0x75, 0x01,                    //     REPORT_SIZE (1)      0x81, 0x02,                    //     INPUT (Data,Var,Abs) +    0x95, 0x01,                    //     REPORT_COUNT (1) +    0x75, 0x04,                    //     REPORT_SIZE (4) +    0x81, 0x03,                    //     INPUT (Const,Var,Abs)      0x05, 0x01,                    //     USAGE_PAGE (Generic Desktop)      0x09, 0x30,                    //     USAGE (X)      0x09, 0x31,                    //     USAGE (Y) diff --git a/usbdrv/usbconfig.h b/usbdrv/usbconfig.h index a5a0c0a..a0e19f1 100644 --- a/usbdrv/usbconfig.h +++ b/usbdrv/usbconfig.h @@ -279,7 +279,7 @@ section at the end of this file).   * HID class is 3, no subclass and protocol required (but may be useful!)   * CDC class is 2, use subclass 2 and protocol 1 for ACM   */ -#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH    50 +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH    56  /* Define this to the length of the HID report descriptor, if you implement   * an HID device. Otherwise don't define it or define it to 0.   * If you use this define, you must add a PROGMEM character array named  | 
