File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 41
41
#define USB_HID_DEVICE_MOUSE 1
42
42
#define USB_HID_DEVICE_CONSUMER 1
43
43
#define USB_HID_DEVICE_SYS_CONTROL 1
44
- #define USB_HID_DEVICE_GAMEPAD 0
45
- #define USB_HID_DEVICE_DIGITIZER 0
44
+ #define USB_HID_DEVICE_GAMEPAD 1
45
+ #define USB_HID_DEVICE_DIGITIZER 0 // not supported yet
46
46
47
47
enum {
48
48
USB_HID_REPORT_ID_UNUSED = 0 ,
73
73
};
74
74
75
75
#define USB_HID_NUM_DEVICES (USB_HID_DEVICE_KEYBOARD + USB_HID_DEVICE_MOUSE + USB_HID_DEVICE_CONSUMER + \
76
- USB_HID_REPORT_ID_SYS_CONTROL + USB_HID_DEVICE_GAMEPAD + USB_HID_DEVICE_DIGITIZER )
76
+ USB_HID_DEVICE_SYS_CONTROL + USB_HID_DEVICE_GAMEPAD + USB_HID_DEVICE_DIGITIZER )
77
77
78
78
typedef struct {
79
79
mp_obj_base_t base ;
@@ -85,7 +85,7 @@ typedef struct {
85
85
} usb_hid_device_obj_t ;
86
86
87
87
88
- usb_hid_device_obj_t usb_hid_devices [USB_HID_NUM_DEVICES ];
88
+ extern usb_hid_device_obj_t usb_hid_devices [];
89
89
90
90
#ifdef __cplusplus
91
91
}
Original file line number Diff line number Diff line change 36
36
#define USB_HID_REPORT_LENGTH_MOUSE 4
37
37
#define USB_HID_REPORT_LENGTH_CONSUMER 2
38
38
#define USB_HID_REPORT_LENGTH_SYS_CONTROL 1
39
+ #define USB_HID_REPORT_LENGTH_GAMEPAD 6
40
+ #define USB_HID_REPORT_LENGTH_DIGITIZER 5
39
41
40
42
#if USB_HID_DEVICE_KEYBOARD
41
43
static uint8_t keyboard_report_buffer [USB_HID_REPORT_LENGTH_KEYBOARD ];
Original file line number Diff line number Diff line change @@ -154,6 +154,10 @@ uint8_t const usb_desc_hid_generic_report[] =
154
154
HID_REPORT_DESC_SYSTEM_CONTROL ( HID_REPORT_ID (USB_HID_REPORT_ID_SYS_CONTROL ), ),
155
155
#endif
156
156
157
+ #if USB_HID_DEVICE_GAMEPAD
158
+ HID_REPORT_DESC_GAMEPAD ( HID_REPORT_ID (USB_HID_REPORT_ID_GAMEPAD ), )
159
+ #endif
160
+
157
161
};
158
162
159
163
//--------------------------------------------------------------------+
You can’t perform that action at this time.
0 commit comments