8000 all hid devices seems to be ok · sparkfun/circuitpython@05139e2 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 05139e2

Browse files
committed
all hid devices seems to be ok
1 parent 2c85f42 commit 05139e2

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

ports/nrf/common-hal/usb_hid/Device.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
#define USB_HID_DEVICE_MOUSE 1
4242
#define USB_HID_DEVICE_CONSUMER 1
4343
#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
4646

4747
enum {
4848
USB_HID_REPORT_ID_UNUSED = 0,
@@ -73,7 +73,7 @@ enum {
7373
};
7474

7575
#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 )
7777

7878
typedef struct {
7979
mp_obj_base_t base;
@@ -85,7 +85,7 @@ typedef struct {
8585
} usb_hid_device_obj_t;
8686

8787

88-
usb_hid_device_obj_t usb_hid_devices[USB_HID_NUM_DEVICES];
88+
extern usb_hid_device_obj_t usb_hid_devices[];
8989

9090
#ifdef __cplusplus
9191
}

ports/nrf/common-hal/usb_hid/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#define USB_HID_REPORT_LENGTH_MOUSE 4
3737
#define USB_HID_REPORT_LENGTH_CONSUMER 2
3838
#define USB_HID_REPORT_LENGTH_SYS_CONTROL 1
39+
#define USB_HID_REPORT_LENGTH_GAMEPAD 6
40+
#define USB_HID_REPORT_LENGTH_DIGITIZER 5
3941

4042
#if USB_HID_DEVICE_KEYBOARD
4143
static uint8_t keyboard_report_buffer[USB_HID_REPORT_LENGTH_KEYBOARD];

ports/nrf/usb/usb_desc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ uint8_t const usb_desc_hid_generic_report[] =
154154
HID_REPORT_DESC_SYSTEM_CONTROL( HID_REPORT_ID(USB_HID_REPORT_ID_SYS_CONTROL ), ),
155155
#endif
156156

157+
#if USB_HID_DEVICE_GAMEPAD
158+
HID_REPORT_DESC_GAMEPAD( HID_REPORT_ID(USB_HID_REPORT_ID_GAMEPAD ), )
159+
#endif
160+
157161
};
158162

159163
//--------------------------------------------------------------------+

0 commit comments

Comments
 (0)
0