Skip to content

Commit badf32e

Browse files
committed
Add HID OUT
1 parent 1205d3e commit badf32e

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

supervisor/supervisor.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ifndef USB_MSC_EP_NUM_IN
118118
USB_MSC_EP_NUM_IN = 0
119119
endif
120120

121+
ifndef USB_HID_EP_NUM_OUT
122+
USB_HID_EP_NUM_OUT = 0
123+
endif
124+
121125
ifndef USB_HID_EP_NUM_IN
122126
USB_HID_EP_NUM_IN = 0
123127
endif
@@ -155,6 +159,7 @@ autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile
155159
--cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\
156160
--msc_ep_num_out $(USB_MSC_EP_NUM_OUT)\
157161
--msc_ep_num_in $(USB_MSC_EP_NUM_IN)\
162+
--hid_ep_num_out $(USB_HID_EP_NUM_OUT)\
158163
--hid_ep_num_in $(USB_HID_EP_NUM_IN)\
159164
--midi_ep_num_out $(USB_MIDI_EP_NUM_OUT)\
160165
--midi_ep_num_in $(USB_MIDI_EP_NUM_IN)\

tools/gen_usb_descriptor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
help='endpoint number of MSC OUT')
4545
parser.add_argument('--msc_ep_num_in', type=int, default=0,
4646
help='endpoint number of MSC IN')
47+
parser.add_argument('--hid_ep_num_out', type=int, default=0,
48+
help='endpoint number of HID OUT')
4749
parser.add_argument('--hid_ep_num_in', type=int, default=0,
4850
help='endpoint number of HID IN')
4951
parser.add_argument('--midi_ep_num_out', type=int, default=0,
@@ -74,7 +76,7 @@
7476
raise ValueError("Endpoint address must not be 0")
7577

7678
if 'HID' in args.devices:
77-
if args.hid_ep_num_in == 0:
79+
if args.args.hid_ep_num_out == 0 or args.hid_ep_num_in == 0:
7880
raise ValueError("Endpoint address must not be 0")
7981

8082
if 'AUDIO' in args.devices:
@@ -231,7 +233,7 @@ def strings_in_order(cls):
231233

232234
hid_endpoint_out_descriptor = standard.EndpointDescriptor(
233235
description="HID out",
234-
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT,
236+
bEndpointAddress=args.hid_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT,
235237
bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
236238
bInterval=8)
237239

0 commit comments

Comments
 (0)