30
30
31
31
#include "common-hal/usb_hid/Device.h"
32
32
#include "shared-bindings/usb_hid/Device.h"
33
+ #include "tusb.h"
33
34
34
35
#define USB_HID_REPORT_LENGTH_KEYBOARD 8
35
36
#define USB_HID_REPORT_LENGTH_MOUSE 4
@@ -66,8 +67,8 @@ usb_hid_device_obj_t usb_hid_devices[USB_HID_NUM_DEVICES] = {
66
67
.report_buffer = keyboard_report_buffer ,
67
68
.report_id = USB_HID_REPORT_ID_KEYBOARD ,
68
69
.report_length = USB_HID_REPORT_LENGTH_KEYBOARD ,
69
- .usage_page = 0x01 ,
70
- .usage = 0x06 ,
70
+ .usage_page = HID_USAGE_PAGE_DESKTOP ,
71
+ .usage = HID_USAGE_DESKTOP_KEYBOARD ,
71
72
},
72
73
#endif
73
74
@@ -77,28 +78,26 @@ usb_hid_device_obj_t usb_hid_devices[USB_HID_NUM_DEVICES] = {
77
78
.report_buffer = mouse_report_buffer ,
78
79
.report_id = USB_HID_REPORT_ID_MOUSE ,
79
80
.report_length = USB_HID_REPORT_LENGTH_MOUSE ,
80
- .usage_page = 0x01 ,
81
- .usage = 0x02 ,
81
+ .usage_page = HID_USAGE_PAGE_DESKTOP ,
82
+ .usage = HID_USAGE_DESKTOP_MOUSE ,
82
83
},
83
84
#endif
84
85
85
86
#if USB_HID_DEVICE_CONSUMER
86
87
{
87
88
.base = { .type = & usb_hid_device_type },
88
89
.report_buffer = consumer_report_buffer ,
89
- .endpoint = USB_HID_ENDPOINT_IN ,
90
90
.report_id = USB_HID_REPORT_ID_CONSUMER ,
91
91
.report_length = USB_HID_REPORT_LENGTH_CONSUMER ,
92
- .usage_page = 0x0C ,
93
- .usage = 0x01 ,
92
+ .usage_page = HID_USAGE_PAGE_CONSUMER ,
93
+ .usage = HID_USAGE_CONSUMER_CONTROL ,
94
94
},
95
95
#endif
96
96
97
97
#ifdef USB_HID_REPORT_ID_SYS_CONTROL
98
98
{
99
99
.base = { .type = & usb_hid_device_type },
100
100
.report_buffer = sys_control_report_buffer ,
101
- .endpoint = USB_HID_ENDPOINT_IN ,
102
101
.report_id = USB_HID_REPORT_ID_SYS_CONTROL ,
103
102
.report_length = USB_HID_REPORT_LENGTH_SYS_CONTROL ,
104
103
.usage_page = 0x01 ,
@@ -109,7 +108,6 @@ usb_hid_device_obj_t usb_hid_devices[USB_HID_NUM_DEVICES] = {
109
108
{
110
109
.base = { .type = & usb_hid_device_type },
111
110
.report_buffer = gamepad_report_buffer ,
112
- .endpoint = USB_HID_ENDPOINT_IN ,
113
111
.report_id = USB_HID_REPORT_ID_GAMEPAD ,
114
112
.report_length = USB_HID_REPORT_LENGTH_GAMEPAD ,
115
113
.usage_page = 0x01 ,
0 commit comments