summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--supervisor/supervisor.mk49
-rw-r--r--tools/gen_usb_descriptor.py4
2 files changed, 27 insertions, 26 deletions
diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk
index 7aac85958..e1d5f5951 100644
--- a/supervisor/supervisor.mk
+++ b/supervisor/supervisor.mk
@@ -94,10 +94,6 @@ ifndef USB_HID_DEVICES
USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD"
endif
-ifndef USB_RENUMBER_ENDPOINTS
-USB_RENUMBER_ENDPOINTS = 1
-endif
-
ifndef USB_CDC_EP_NUM_NOTIFICATION
USB_CDC_EP_NUM_NOTIFICATION = 0
endif
@@ -134,6 +130,30 @@ ifndef USB_MIDI_EP_NUM_IN
USB_MIDI_EP_NUM_IN = 0
endif
+USB_DESCRIPTOR_ARGS = \
+ --manufacturer $(USB_MANUFACTURER)\
+ --product $(USB_PRODUCT)\
+ --vid $(USB_VID)\
+ --pid $(USB_PID)\
+ --serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\
+ --devices $(USB_DEVICES)\
+ --hid_devices $(USB_HID_DEVICES)\
+ --cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\
+ --cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\
+ --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)\
+ --output_c_file $(BUILD)/autogen_usb_descriptor.c\
+ --output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h
+
+ifeq ($(USB_RENUMBER_ENDPOINTS), 0)
+USB_DESCRIPTOR_ARGS += --no-renumber_endpoints
+endif
+
SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o)) $(BUILD)/autogen_display_resources.o
$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h
@@ -145,26 +165,7 @@ $(BUILD)/autogen_usb_descriptor.c $(BUILD)/genhdr/autogen_usb_descriptor.h: auto
autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile | $(HEADER_BUILD)
$(STEPECHO) "GEN $@"
$(Q)install -d $(BUILD)/genhdr
- $(Q)$(PYTHON3) ../../tools/gen_usb_descriptor.py \
- --manufacturer $(USB_MANUFACTURER)\
- --product $(USB_PRODUCT)\
- --vid $(USB_VID)\
- --pid $(USB_PID)\
- --serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\
- --devices $(USB_DEVICES)\
- --hid_devices $(USB_HID_DEVICES)\
- --renumber_endpoints $(USB_RENUMBER_ENDPOINTS)\
- --cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\
- --cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\
- --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)\
- --output_c_file $(BUILD)/autogen_usb_descriptor.c\
- --output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h
+ $(Q)$(PYTHON3) ../../tools/gen_usb_descriptor.py $(USB_DESCRIPTOR_ARGS)
CIRCUITPY_DISPLAY_FONT ?= "../../tools/fonts/ter-u12n.bdf"
diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py
index 916e3ec47..74f6584f8 100644
--- a/tools/gen_usb_descriptor.py
+++ b/tools/gen_usb_descriptor.py
@@ -32,8 +32,8 @@ parser.add_argument('--devices', type=lambda l: tuple(l.split(',')), default=DEF
help='devices to include in descriptor (AUDIO includes MIDI support)')
parser.add_argument('--hid_devices', type=lambda l: tuple(l.split(',')), default=DEFAULT_HID_DEVICES,
help='HID devices to include in HID report descriptor')
-parser.add_argument('--renumber_endpoints', type=int, default=1,
- help='use relative(1) or absolute(0) endpoint number')
+parser.add_argument('--no-renumber_endpoints', dest='renumber_endpoints', action='store_false',
+ help='use to not renumber endpoint')
parser.add_argument('--cdc_ep_num_notification', type=int, default=0,
help='endpoint number of CDC NOTIFICATION')
parser.add_argument('--cdc_ep_num_data_out', type=int, default=0,