Add HID OUT

crypto-aes
Kamil Tomaszewski 3 years ago
parent 1205d3e305
commit badf32e88d
  1. 5
      supervisor/supervisor.mk
  2. 6
      tools/gen_usb_descriptor.py

@ -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)\

@ -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)

Loading…
Cancel
Save