usb descriptors all set; rework of enabling for USB devices
This commit is contained in:
parent
8789a2c8a9
commit
0802b22ed6
@ -18,7 +18,16 @@ ifeq ($(LONGINT_IMPL),LONGLONG)
|
||||
MPY_TOOL_LONGINT_IMPL = -mlongint-impl=longlong
|
||||
endif
|
||||
|
||||
INTERNAL_LIBM = 1
|
||||
|
||||
USB_SERIAL_NUMBER_LENGTH = 32
|
||||
|
||||
# Number of USB endpoint pairs.
|
||||
USB_NUM_EP = 8
|
||||
|
||||
######################################################################
|
||||
# Put samd21-only choices here.
|
||||
|
||||
ifeq ($(CHIP_FAMILY),samd21)
|
||||
|
||||
# The ?='s allow overriding in mpconfigboard.mk.
|
||||
@ -40,7 +49,9 @@ CIRCUITPY_SDCARDIO ?= 0
|
||||
CIRCUITPY_FRAMEBUFFERIO ?= 0
|
||||
|
||||
# SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic.
|
||||
# Because of that, there aren't enough endpoints for serial2.
|
||||
USB_MSC_EP_NUM_OUT = 1
|
||||
CIRCUITPY_USB_SERIAL2 = 0
|
||||
|
||||
CIRCUITPY_ULAB = 0
|
||||
|
||||
@ -55,9 +66,13 @@ CIRCUITPY_TERMINALIO = 0
|
||||
endif
|
||||
|
||||
endif # samd21
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# Put samd51-only choices here.
|
||||
|
||||
ifeq ($(CHIP_FAMILY),samd51)
|
||||
|
||||
# No native touchio on SAMD51.
|
||||
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
|
||||
|
||||
@ -70,9 +85,4 @@ CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD)
|
||||
|
||||
endif # samd51
|
||||
|
||||
INTERNAL_LIBM = 1
|
||||
|
||||
USB_SERIAL_NUMBER_LENGTH = 32
|
||||
|
||||
USB_NUM_EP = 8
|
||||
######################################################################
|
||||
|
@ -2,7 +2,6 @@ USB_VID = 0x303a
|
||||
USB_PID = 0x8007
|
||||
USB_PRODUCT = "TTGO T8 ESP32-S2"
|
||||
USB_MANUFACTURER = "LILYGO"
|
||||
USB_DEVICES = "CDC,MSC,HID"
|
||||
|
||||
INTERNAL_FLASH_FILESYSTEM = 1
|
||||
LONGINT_IMPL = MPZ
|
||||
|
@ -2,7 +2,6 @@ USB_VID = 0x239A
|
||||
USB_PID = 0x80C6
|
||||
USB_PRODUCT = "microS2"
|
||||
USB_MANUFACTURER = "microDev"
|
||||
USB_DEVICES = "CDC,MSC,HID"
|
||||
|
||||
INTERNAL_FLASH_FILESYSTEM = 1
|
||||
LONGINT_IMPL = MPZ
|
||||
|
@ -2,7 +2,6 @@ USB_VID = 0x239A
|
||||
USB_PID = 0x80AC
|
||||
USB_PRODUCT = "FeatherS2"
|
||||
USB_MANUFACTURER = "UnexpectedMaker"
|
||||
USB_DEVICES = "CDC,MSC,HID"
|
||||
|
||||
INTERNAL_FLASH_FILESYSTEM = 1
|
||||
LONGINT_IMPL = MPZ
|
||||
|
@ -2,7 +2,6 @@ USB_VID = 0x239A
|
||||
USB_PID = 0x80AC
|
||||
USB_PRODUCT = "FeatherS2"
|
||||
USB_MANUFACTURER = "UnexpectedMaker"
|
||||
USB_DEVICES = "CDC,MSC,HID"
|
||||
|
||||
INTERNAL_FLASH_FILESYSTEM = 1
|
||||
LONGINT_IMPL = MPZ
|
||||
|
@ -6,6 +6,9 @@ MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz
|
||||
# Internal math library is substantially smaller than toolchain one
|
||||
INTERNAL_LIBM = 1
|
||||
|
||||
# Number of USB endpoint pairs.
|
||||
USB_NUM_EP = 16
|
||||
|
||||
# Chip supplied serial number, in bytes
|
||||
USB_SERIAL_NUMBER_LENGTH = 30
|
||||
|
||||
|
@ -17,6 +17,9 @@ INTERNAL_LIBM = 1
|
||||
USB_SERIAL_NUMBER_LENGTH = 32
|
||||
USB_HIGHSPEED = 1
|
||||
|
||||
# Number of USB endpoint pairs.
|
||||
USB_NUM_EP = 8
|
||||
|
||||
INTERNAL_FLASH_FILESYSTEM = 1
|
||||
|
||||
CIRCUITPY_AUDIOIO = 0
|
||||
|
@ -11,6 +11,9 @@ INTERNAL_LIBM = 1
|
||||
|
||||
USB_SERIAL_NUMBER_LENGTH = 16
|
||||
|
||||
# Number of USB endpoint pairs.
|
||||
USB_NUM_EP = 8
|
||||
|
||||
# All nRF ports have longints.
|
||||
LONGINT_IMPL = MPZ
|
||||
|
||||
|
@ -44,4 +44,5 @@ INTERNAL_LIBM = 1
|
||||
|
||||
USB_SERIAL_NUMBER_LENGTH = 32
|
||||
|
||||
# Number of USB endpoint pairs.
|
||||
USB_NUM_EP = 8
|
||||
|
@ -2,7 +2,9 @@ USB_VID = 0x239A
|
||||
USB_PID = 0x8071
|
||||
USB_PRODUCT = "Thunderpack STM32F411"
|
||||
USB_MANUFACTURER = "Jeremy Gillick"
|
||||
USB_DEVICES = "CDC,MSC"
|
||||
|
||||
# Turn off HID devices
|
||||
CIRCUITPY_USB_HID = 0
|
||||
|
||||
LONGINT_IMPL = NONE
|
||||
|
||||
|
@ -8,6 +8,7 @@ ifeq ($(MCU_VARIANT),STM32F405xx)
|
||||
CIRCUITPY_FRAMEBUFFERIO ?= 1
|
||||
CIRCUITPY_RGBMATRIX ?= 1
|
||||
CIRCUITPY_SDIOIO ?= 1
|
||||
# Number of USB endpoint pairs.
|
||||
USB_NUM_EP = 4
|
||||
endif
|
||||
|
||||
@ -23,6 +24,8 @@ ifeq ($(MCU_SERIES),F4)
|
||||
CIRCUITPY_RTC ?= 0
|
||||
CIRCUITPY_USB_MIDI ?= 0
|
||||
CIRCUITPY_USB_HID ?= 0
|
||||
|
||||
USB_NUM_EP = 4
|
||||
endif
|
||||
|
||||
ifeq ($(MCU_SERIES),H7)
|
||||
@ -40,6 +43,8 @@ ifeq ($(MCU_SERIES),H7)
|
||||
CIRCUITPY_RTC ?= 0
|
||||
CIRCUITPY_USB_HID ?= 0
|
||||
CIRCUITPY_USB_MIDI ?= 0
|
||||
|
||||
USB_NUM_EP = 9
|
||||
endif
|
||||
|
||||
ifeq ($(MCU_SERIES),F7)
|
||||
@ -56,4 +61,6 @@ ifeq ($(MCU_SERIES),F7)
|
||||
CIRCUITPY_RTC ?= 0
|
||||
CIRCUITPY_USB_HID ?= 0
|
||||
CIRCUITPY_USB_MIDI ?= 0
|
||||
|
||||
USB_NUM_EP = 6
|
||||
endif
|
||||
|
@ -89,6 +89,9 @@ CFLAGS += -DCIRCUITPY_AUDIOMP3=$(CIRCUITPY_AUDIOMP3)
|
||||
CIRCUITPY_BINASCII ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CFLAGS += -DCIRCUITPY_BINASCII=$(CIRCUITPY_BINASCII)
|
||||
|
||||
CIRCUITPY_BITBANG_APA102 ?= 0
|
||||
CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102)
|
||||
|
||||
CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO)
|
||||
|
||||
@ -100,6 +103,9 @@ CFLAGS += -DCIRCUITPY_BLEIO_HCI=$(CIRCUITPY_BLEIO_HCI)
|
||||
CIRCUITPY_BLEIO ?= $(CIRCUITPY_BLEIO_HCI)
|
||||
CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO)
|
||||
|
||||
CIRCUITPY_BLE_FILE_SERVICE ?= 0
|
||||
CFLAGS += -DCIRCUITPY_BLE_FILE_SERVICE=$(CIRCUITPY_BLE_FILE_SERVICE)
|
||||
|
||||
CIRCUITPY_BOARD ?= 1
|
||||
CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD)
|
||||
|
||||
@ -127,6 +133,13 @@ CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO)
|
||||
CIRCUITPY_DISPLAYIO ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO)
|
||||
|
||||
CIRCUITPY_DUALBANK ?= 0
|
||||
CFLAGS += -DCIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK)
|
||||
|
||||
# Enabled micropython.native decorator (experimental)
|
||||
CIRCUITPY_ENABLE_MPY_NATIVE ?= 0
|
||||
CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE)
|
||||
|
||||
CIRCUITPY_ERRNO ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CFLAGS += -DCIRCUITPY_ERRNO=$(CIRCUITPY_ERRNO)
|
||||
|
||||
@ -179,6 +192,9 @@ CFLAGS += -DCIRCUITPY_MEMORYMONITOR=$(CIRCUITPY_MEMORYMONITOR)
|
||||
CIRCUITPY_MICROCONTROLLER ?= 1
|
||||
CFLAGS += -DCIRCUITPY_MICROCONTROLLER=$(CIRCUITPY_MICROCONTROLLER)
|
||||
|
||||
CIRCUITPY_MSGPACK ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CFLAGS += -DCIRCUITPY_MSGPACK=$(CIRCUITPY_MSGPACK)
|
||||
|
||||
CIRCUITPY_NEOPIXEL_WRITE ?= 1
|
||||
CFLAGS += -DCIRCUITPY_NEOPIXEL_WRITE=$(CIRCUITPY_NEOPIXEL_WRITE)
|
||||
|
||||
@ -192,8 +208,8 @@ CFLAGS += -DCIRCUITPY_NVM=$(CIRCUITPY_NVM)
|
||||
CIRCUITPY_OS ?= 1
|
||||
CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS)
|
||||
|
||||
CIRCUITPY_DUALBANK ?= 0
|
||||
CFLAGS += -DCIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK)
|
||||
CIRCUITPY_PEW ?= 0
|
||||
CFLAGS += -DCIRCUITPY_PEW=$(CIRCUITPY_PEW)
|
||||
|
||||
CIRCUITPY_PIXELBUF ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF)
|
||||
@ -216,6 +232,11 @@ CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM)
|
||||
CIRCUITPY_RE ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CFLAGS += -DCIRCUITPY_RE=$(CIRCUITPY_RE)
|
||||
|
||||
# Should busio.I2C() check for pullups?
|
||||
# Some boards in combination with certain peripherals may not want this.
|
||||
CIRCUITPY_REQUIRE_I2C_PULLUPS ?= 1
|
||||
CFLAGS += -DCIRCUITPY_REQUIRE_I2C_PULLUPS=$(CIRCUITPY_REQUIRE_I2C_PULLUPS)
|
||||
|
||||
# CIRCUITPY_RP2PIO is handled in the raspberrypi tree.
|
||||
# Only for rp2 chips.
|
||||
# Assume not a rp2 build.
|
||||
@ -243,6 +264,18 @@ CFLAGS += -DCIRCUITPY_SDCARDIO=$(CIRCUITPY_SDCARDIO)
|
||||
CIRCUITPY_SDIOIO ?= 0
|
||||
CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO)
|
||||
|
||||
# Second USB CDC serial channel.
|
||||
CIRCUITPY_SERIAL2 ?=
|
||||
CFLAGS += -DCIRCUITPY_SERIAL2=$(CIRCUITPY_SERIAL2)
|
||||
|
||||
# REPL over BLE
|
||||
CIRCUITPY_SERIAL_BLE ?= 0
|
||||
CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE)
|
||||
|
||||
# REPL over UART
|
||||
CIRCUITPY_SERIAL_UART ?= 0
|
||||
CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART)
|
||||
|
||||
CIRCUITPY_SHARPDISPLAY ?= $(CIRCUITPY_FRAMEBUFFERIO)
|
||||
CFLAGS += -DCIRCUITPY_SHARPDISPLAY=$(CIRCUITPY_SHARPDISPLAY)
|
||||
|
||||
@ -285,37 +318,48 @@ CFLAGS += -DCIRCUITPY_UHEAP=$(CIRCUITPY_UHEAP)
|
||||
CIRCUITPY_USB_HID ?= 1
|
||||
CFLAGS += -DCIRCUITPY_USB_HID=$(CIRCUITPY_USB_HID)
|
||||
|
||||
CIRCUITPY_USB_HID_CONSUMER ?= 1
|
||||
CFLAGS += -DCIRCUITPY_USB_HID_CONSUMER=$(CIRCUITPY_USB_HID_CONSUMER)
|
||||
|
||||
CIRCUITPY_USB_HID_DIGITIZER ?= 0
|
||||
CFLAGS += -DCIRCUITPY_USB_HID_DIGITIZER=$(CIRCUITPY_USB_HID_DIGITIZER)
|
||||
|
||||
CIRCUITPY_USB_HID_GAMEPAD ?= 1
|
||||
CFLAGS += -DCIRCUITPY_USB_HID_GAMEPAD=$(CIRCUITPY_USB_HID_GAMEPAD)
|
||||
|
||||
CIRCUITPY_USB_HID_KEYBOARD ?= 1
|
||||
CFLAGS += -DCIRCUITPY_USB_HID_KEYBOARD=$(CIRCUITPY_USB_HID_KEYBOARD)
|
||||
|
||||
CIRCUITPY_USB_HID_MOUSE ?= 1
|
||||
CFLAGS += -DCIRCUITPY_USB_HID_MOUSE=$(CIRCUITPY_USB_HID_MOUSE)
|
||||
|
||||
CIRCUITPY_USB_HID_SYS_CONTROL ?= 0
|
||||
CFLAGS += -DCIRCUITPY_USB_HID_CONTROL=$(CIRCUITPY_USB_HID_CONTROL)
|
||||
|
||||
CIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD ?= 0
|
||||
CFLAGS += -DCIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD=$(CIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD)
|
||||
|
||||
CIRCUITPY_USB_MIDI ?= 1
|
||||
CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI)
|
||||
|
||||
CIRCUITPY_PEW ?= 0
|
||||
CFLAGS += -DCIRCUITPY_PEW=$(CIRCUITPY_PEW)
|
||||
CIRCUITPY_USB_MSC ?= 1
|
||||
CFLAGS += -DCIRCUITPY_USB_MSC=$(CIRCUITPY_USB_MSC)
|
||||
|
||||
CIRCUITPY_USB_SERIAL ?= 1
|
||||
CFLAGS += -DCIRCUITPY_USB_SERIAL=$(CIRCUITPY_USB_MSC)
|
||||
|
||||
ifndef USB_NUM_EP
|
||||
$(error "USB_NUM_EP (number of USB endpoint pairs)must be defined")
|
||||
endif
|
||||
|
||||
# Secondary CDC is usually available if there are at least 8 endpoints.
|
||||
CIRCUITPY_USB_SERIAL2 ?= $(shell expr $(USB_NUM_EP) '>=' 8)
|
||||
CFLAGS += -DCIRCUITPY_USB_SERIAL2=$(CIRCUITPY_USB_SERIAL2)
|
||||
|
||||
# For debugging.
|
||||
CIRCUITPY_USTACK ?= 0
|
||||
CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK)
|
||||
|
||||
# Non-module conditionals
|
||||
|
||||
CIRCUITPY_BITBANG_APA102 ?= 0
|
||||
CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102)
|
||||
|
||||
# Should busio.I2C() check for pullups?
|
||||
# Some boards in combination with certain peripherals may not want this.
|
||||
CIRCUITPY_REQUIRE_I2C_PULLUPS ?= 1
|
||||
CFLAGS += -DCIRCUITPY_REQUIRE_I2C_PULLUPS=$(CIRCUITPY_REQUIRE_I2C_PULLUPS)
|
||||
|
||||
# REPL over BLE
|
||||
CIRCUITPY_SERIAL_BLE ?= 0
|
||||
CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE)
|
||||
|
||||
CIRCUITPY_BLE_FILE_SERVICE ?= 0
|
||||
CFLAGS += -DCIRCUITPY_BLE_FILE_SERVICE=$(CIRCUITPY_BLE_FILE_SERVICE)
|
||||
|
||||
# REPL over UART
|
||||
CIRCUITPY_SERIAL_UART ?= 0
|
||||
CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART)
|
||||
|
||||
# ulab numerics library
|
||||
CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB)
|
||||
@ -326,10 +370,3 @@ CFLAGS += -DCIRCUITPY_WATCHDOG=$(CIRCUITPY_WATCHDOG)
|
||||
|
||||
CIRCUITPY_WIFI ?= 0
|
||||
CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI)
|
||||
|
||||
# Enabled micropython.native decorator (experimental)
|
||||
CIRCUITPY_ENABLE_MPY_NATIVE ?= 0
|
||||
CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE)
|
||||
|
||||
CIRCUITPY_MSGPACK ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CFLAGS += -DCIRCUITPY_MSGPACK=$(CIRCUITPY_MSGPACK)
|
||||
|
@ -61,10 +61,15 @@
|
||||
// DEVICE CONFIGURATION
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
#define CFG_TUD_ENDOINT0_SIZE 64
|
||||
#define CFG_TUD_ENDPOINT0_SIZE 64
|
||||
|
||||
//------------- CLASS -------------//
|
||||
|
||||
// Could be 2 if secondary CDC channel requested.
|
||||
#ifndef CFG_TUD_CDC
|
||||
#define CFG_TUD_CDC 1
|
||||
#endif
|
||||
|
||||
#define CFG_TUD_MSC 1
|
||||
#define CFG_TUD_HID CIRCUITPY_USB_HID
|
||||
#define CFG_TUD_MIDI CIRCUITPY_USB_MIDI
|
||||
|
@ -14,23 +14,15 @@ SRC_SUPERVISOR = \
|
||||
supervisor/shared/tick.c \
|
||||
supervisor/shared/translate.c
|
||||
|
||||
ifndef $(NO_USB)
|
||||
NO_USB = $(wildcard supervisor/usb.c)
|
||||
endif
|
||||
NO_USB ?= $(wildcard supervisor/usb.c)
|
||||
|
||||
ifndef INTERNAL_FLASH_FILESYSTEM
|
||||
INTERNAL_FLASH_FILESYSTEM = 0
|
||||
endif
|
||||
INTERNAL_FLASH_FILESYSTEM ?= 0
|
||||
CFLAGS += -DINTERNAL_FLASH_FILESYSTEM=$(INTERNAL_FLASH_FILESYSTEM)
|
||||
|
||||
ifndef QSPI_FLASH_FILESYSTEM
|
||||
QSPI_FLASH_FILESYSTEM = 0
|
||||
endif
|
||||
QSPI_FLASH_FILESYSTEM ?= 0
|
||||
CFLAGS += -DQSPI_FLASH_FILESYSTEM=$(QSPI_FLASH_FILESYSTEM)
|
||||
|
||||
ifndef SPI_FLASH_FILESYSTEM
|
||||
SPI_FLASH_FILESYSTEM = 0
|
||||
endif
|
||||
CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM)
|
||||
|
||||
ifeq ($(CIRCUITPY_BLEIO),1)
|
||||
@ -115,66 +107,78 @@ ifeq ($(CIRCUITPY_DISPLAYIO), 1)
|
||||
SUPERVISOR_O += $(BUILD)/autogen_display_resources.o
|
||||
endif
|
||||
endif
|
||||
ifndef USB_INTERFACE_NAME
|
||||
USB_INTERFACE_NAME = "CircuitPython"
|
||||
|
||||
USB_INTERFACE_NAME ?= "CircuitPython"
|
||||
|
||||
ifneq ($(USB_VID),)
|
||||
CFLAGS += -DUSB_VID=$(USB_VID)
|
||||
CFLAGS += -DSUB_PID=$(USB_PID)
|
||||
CFLAGS += -DUSB_MANUFACTURER=$(USB_MANUFACTURER)
|
||||
CFLAGS += -DUSB_PRODUCT=$(USB_PRODUCT)
|
||||
endif
|
||||
|
||||
USB_DEVICES_COMPUTED := CDC,MSC
|
||||
ifeq ($(CIRCUITPY_USB_MIDI),1)
|
||||
USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),AUDIO
|
||||
endif
|
||||
USB_DEVICES =
|
||||
ifeq ($(CIRCUITPY_USB_HID),1)
|
||||
USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID
|
||||
USB_DEVICES += HID
|
||||
endif
|
||||
USB_DEVICES ?= "$(USB_DEVICES_COMPUTED)"
|
||||
|
||||
ifndef USB_HID_DEVICES
|
||||
USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD"
|
||||
ifeq ($(CIRCUITPY_USB_MIDI),1)
|
||||
USB_DEVICES += AUDIO
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_USB_MSC),1)
|
||||
USB_DEVICES += MSC
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_USB_SERIAL),1)
|
||||
USB_DEVICES += CDC
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_USB_SERIAL2),1)
|
||||
# Inform TinyUSB there are two CDC devices.
|
||||
CFLAGS += -DCFG_TUD_CDC=2
|
||||
USB_DEVICES += CDC2
|
||||
endif
|
||||
|
||||
ifndef USB_HIGHSPEED
|
||||
USB_HIGHSPEED = 0
|
||||
USB_HID_DEVICES =
|
||||
ifeq ($(CIRCUITPY_USB_HID_CONSUMER),1)
|
||||
USB_HID_DEVICES += CONSUMER
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_USB_HID_DIGITIZER),1)
|
||||
USB_HID_DEVICES += DIGITIZER
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_USB_HID_GAMEPAD),1)
|
||||
USB_HID_DEVICES += GAMEPAD
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_USB_HID_KEYBOARD),1)
|
||||
USB_HID_DEVICES += KEYBOARD
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_USB_HID_MOUSE),1)
|
||||
USB_HID_DEVICES += MOUSE
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_USB_HID_SYS_CONTROL),1)
|
||||
USB_HID_DEVICES += SYS_CONTROL
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD),1)
|
||||
USB_HID_DEVICES += XAC_COMPATIBLE_GAMEPAD
|
||||
endif
|
||||
|
||||
ifndef USB_CDC_EP_NUM_NOTIFICATION
|
||||
USB_CDC_EP_NUM_NOTIFICATION = 0
|
||||
# RAW is not compatible with other HID devices.
|
||||
ifeq ($(CIRCUITPY_USB_HID_RAW),1)
|
||||
ifneq ($(CIRCUITPY_USB_HID_DEVICES,)
|
||||
$(error HID RAW must not be combined with other HID devices)
|
||||
endif
|
||||
USB_HID_DEVICES += MOUSE
|
||||
endif
|
||||
|
||||
ifndef USB_CDC_EP_NUM_DATA_OUT
|
||||
USB_CDC_EP_NUM_DATA_OUT = 0
|
||||
endif
|
||||
USB_HIGHSPEED ?= 0
|
||||
|
||||
ifndef USB_CDC_EP_NUM_DATA_IN
|
||||
USB_CDC_EP_NUM_DATA_IN = 0
|
||||
endif
|
||||
|
||||
ifndef USB_MSC_EP_NUM_OUT
|
||||
USB_MSC_EP_NUM_OUT = 0
|
||||
endif
|
||||
|
||||
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
|
||||
|
||||
ifndef USB_MIDI_EP_NUM_OUT
|
||||
USB_MIDI_EP_NUM_OUT = 0
|
||||
endif
|
||||
|
||||
ifndef USB_MIDI_EP_NUM_IN
|
||||
USB_MIDI_EP_NUM_IN = 0
|
||||
endif
|
||||
|
||||
ifndef USB_NUM_EP
|
||||
USB_NUM_EP = 0
|
||||
endif
|
||||
USB_CDC_EP_NUM_NOTIFICATION ?= 0
|
||||
USB_CDC_EP_NUM_DATA_OUT ?= 0
|
||||
USB_CDC_EP_NUM_DATA_IN ?= 0
|
||||
USB_MSC_EP_NUM_OUT ?= 0
|
||||
USB_MSC_EP_NUM_IN ?= 0
|
||||
USB_HID_EP_NUM_OUT ?= 0
|
||||
USB_HID_EP_NUM_IN ?= 0
|
||||
USB_MIDI_EP_NUM_OUT ?= 0
|
||||
USB_MIDI_EP_NUM_IN ?= 0
|
||||
USB_NUM_EP ?= 0
|
||||
|
||||
USB_DESCRIPTOR_ARGS = \
|
||||
--manufacturer $(USB_MANUFACTURER)\
|
||||
@ -183,8 +187,8 @@ USB_DESCRIPTOR_ARGS = \
|
||||
--pid $(USB_PID)\
|
||||
--serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\
|
||||
--interface_name $(USB_INTERFACE_NAME)\
|
||||
--devices $(USB_DEVICES)\
|
||||
--hid_devices $(USB_HID_DEVICES)\
|
||||
--devices "$(USB_DEVICES)"\
|
||||
--hid_devices "$(USB_HID_DEVICES)"\
|
||||
--max_ep $(USB_NUM_EP) \
|
||||
--cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\
|
||||
--cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
||||
Subproject commit 701cafc50e2e574dccaf7a340eedbd64a0b41a42
|
||||
Subproject commit 2eaa6114b209fe7f0a795eda8d6a7b3b93d76d2e
|
Loading…
x
Reference in New Issue
Block a user