@@ -25,19 +25,27 @@ THE SOFTWARE.
25
25
26
26
27
27
static const uint8_t _hidMultiReportDescriptorGamepad[] PROGMEM = {
28
- /* Gamepad with 32 buttons and 6 axis*/
28
+ /* Gamepad with 16/ 32 buttons and 6 axis*/
29
29
0x05 , 0x01 , /* USAGE_PAGE (Generic Desktop) */
30
30
0x09 , 0x04 , /* USAGE (Joystick) */
31
31
0xa1 , 0x01 , /* COLLECTION (Application) */
32
32
0x85 , HID_REPORTID_GAMEPAD, /* REPORT_ID */
33
- /* 32 Buttons */
33
+ /* 16/ 32 Buttons */
34
34
0x05 , 0x09 , /* USAGE_PAGE (Button) */
35
35
0x19 , 0x01 , /* USAGE_MINIMUM (Button 1) */
36
+ #ifdef HID_ENABLE_32BUTTONS
36
37
0x29 , 0x20 , /* USAGE_MAXIMUM (Button 32) */
38
+ #else
39
+ 0x29 , 0x10 , /* USAGE_MAXIMUM (Button 16) */
40
+ #endif
37
41
0x15 , 0x00 , /* LOGICAL_MINIMUM (0) */
38
42
0x25 , 0x01 , /* LOGICAL_MAXIMUM (1) */
39
43
0x75 , 0x01 , /* REPORT_SIZE (1) */
44
+ #ifdef HID_ENABLE_32BUTTONS
40
45
0x95 , 0x20 , /* REPORT_COUNT (32) */
46
+ #else
47
+ 0x95 , 0x10 , /* REPORT_COUNT (16) */
48
+ #endif
41
49
0x81 , 0x02 , /* INPUT (Data,Var,Abs) */
42
50
/* 4 16bit Axis */
43
51
0x05 , 0x01 , /* USAGE_PAGE (Generic Desktop) */
@@ -51,6 +59,7 @@ static const uint8_t _hidMultiReportDescriptorGamepad[] PROGMEM = {
51
59
0x75 , 0x10 , /* REPORT_SIZE (16) */
52
60
0x95 , 0x04 , /* REPORT_COUNT (4) */
53
61
0x81 , 0x02 , /* INPUT (Data,Var,Abs) */
62
+ #ifdef HID_ENABLE_ZAXIS
54
63
/* 2 8bit Axis */
55
64
0x09 , 0x32 , /* USAGE (Z) */
56
65
0x09 , 0x35 , /* USAGE (Rz) */
@@ -59,6 +68,7 @@ static const uint8_t _hidMultiReportDescriptorGamepad[] PROGMEM = {
59
68
0x75 , 0x08 , /* REPORT_SIZE (8) */
60
69
0x95 , 0x02 , /* REPORT_COUNT (2) */
61
70
0x81 , 0x02 , /* INPUT (Data,Var,Abs) */
71
+ #endif
62
72
0xc0 , /* END_COLLECTION */
63
73
/* 2 Hat Switches */
64
74
0x05 , 0x01 , /* USAGE_PAGE (Generic Desktop) */
0 commit comments