Add HID OUT

This commit is contained in:
Kamil Tomaszewski 2019-10-07 13:40:44 +02:00
parent 1205d3e305
commit badf32e88d
2 changed files with 9 additions and 2 deletions

View File

@ -118,6 +118,10 @@ ifndef USB_MSC_EP_NUM_IN
USB_MSC_EP_NUM_IN = 0
endif
ifndef USB_HID_EP_NUM_OUT
USB_HID_EP_NUM_OUT = 0
endif
ifndef USB_HID_EP_NUM_IN
USB_HID_EP_NUM_IN = 0
endif
@ -155,6 +159,7 @@ autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile
--cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\
--msc_ep_num_out $(USB_MSC_EP_NUM_OUT)\
--msc_ep_num_in $(USB_MSC_EP_NUM_IN)\
--hid_ep_num_out $(USB_HID_EP_NUM_OUT)\
--hid_ep_num_in $(USB_HID_EP_NUM_IN)\
--midi_ep_num_out $(USB_MIDI_EP_NUM_OUT)\
--midi_ep_num_in $(USB_MIDI_EP_NUM_IN)\

View File

@ -44,6 +44,8 @@ parser.add_argument('--msc_ep_num_out', type=int, default=0,
help='endpoint number of MSC OUT')
parser.add_argument('--msc_ep_num_in', type=int, default=0,
help='endpoint number of MSC IN')
parser.add_argument('--hid_ep_num_out', type=int, default=0,
help='endpoint number of HID OUT')
parser.add_argument('--hid_ep_num_in', type=int, default=0,
help='endpoint number of HID IN')
parser.add_argument('--midi_ep_num_out', type=int, default=0,
@ -74,7 +76,7 @@ if not args.renumber_endpoints:
raise ValueError("Endpoint address must not be 0")
if 'HID' in args.devices:
if args.hid_ep_num_in == 0:
if args.args.hid_ep_num_out == 0 or args.hid_ep_num_in == 0:
raise ValueError("Endpoint address must not be 0")
if 'AUDIO' in args.devices:
@ -231,7 +233,7 @@ hid_endpoint_in_descriptor = standard.EndpointDescriptor(
hid_endpoint_out_descriptor = standard.EndpointDescriptor(
description="HID out",
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT,
bEndpointAddress=args.hid_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT,
bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
bInterval=8)