Fix USB midi and hid disable.

This commit is contained in:
Scott Shawcroft 2020-04-21 14:15:44 -07:00
parent 5cc8a3ec82
commit dcb0e50f04
No known key found for this signature in database
GPG Key ID: 9349BC7E64B1921E
3 changed files with 22 additions and 15 deletions

View File

@ -304,7 +304,6 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE))
# Doing a $(sort ...) removes duplicates as part of sorting. # Doing a $(sort ...) removes duplicates as part of sorting.
SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED))
SRC_S = supervisor/$(CHIP_FAMILY)_cpu.s SRC_S = supervisor/$(CHIP_FAMILY)_cpu.s
OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))

View File

@ -74,8 +74,8 @@
//------------- CLASS -------------// //------------- CLASS -------------//
#define CFG_TUD_CDC 1 #define CFG_TUD_CDC 1
#define CFG_TUD_MSC 1 #define CFG_TUD_MSC 1
#define CFG_TUD_HID 1 #define CFG_TUD_HID CIRCUITPY_USB_HID
#define CFG_TUD_MIDI 1 #define CFG_TUD_MIDI CIRCUITPY_USB_MIDI
#define CFG_TUD_CUSTOM_CLASS 0 #define CFG_TUD_CUSTOM_CLASS 0
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/

View File

@ -73,26 +73,34 @@ else
lib/tinyusb/src/device/usbd_control.c \ lib/tinyusb/src/device/usbd_control.c \
lib/tinyusb/src/class/msc/msc_device.c \ lib/tinyusb/src/class/msc/msc_device.c \
lib/tinyusb/src/class/cdc/cdc_device.c \ lib/tinyusb/src/class/cdc/cdc_device.c \
lib/tinyusb/src/class/hid/hid_device.c \
lib/tinyusb/src/class/midi/midi_device.c \
lib/tinyusb/src/tusb.c \ lib/tinyusb/src/tusb.c \
supervisor/shared/serial.c \ supervisor/shared/serial.c \
supervisor/usb.c \ supervisor/usb.c \
supervisor/shared/usb/usb_desc.c \ supervisor/shared/usb/usb_desc.c \
supervisor/shared/usb/usb.c \ supervisor/shared/usb/usb.c \
supervisor/shared/usb/usb_msc_flash.c \ supervisor/shared/usb/usb_msc_flash.c \
shared-bindings/usb_hid/__init__.c \
shared-bindings/usb_hid/Device.c \
shared-bindings/usb_midi/__init__.c \
shared-bindings/usb_midi/PortIn.c \
shared-bindings/usb_midi/PortOut.c \
shared-module/usb_hid/__init__.c \
shared-module/usb_hid/Device.c \
shared-module/usb_midi/__init__.c \
shared-module/usb_midi/PortIn.c \
shared-module/usb_midi/PortOut.c \
$(BUILD)/autogen_usb_descriptor.c $(BUILD)/autogen_usb_descriptor.c
ifeq ($(CIRCUITPY_USB_HID), 1)
SRC_SUPERVISOR += \
lib/tinyusb/src/class/hid/hid_device.c \
shared-bindings/usb_hid/__init__.c \
shared-bindings/usb_hid/Device.c \
shared-module/usb_hid/__init__.c \
shared-module/usb_hid/Device.c
endif
ifeq ($(CIRCUITPY_USB_MIDI), 1)
SRC_SUPERVISOR += \
lib/tinyusb/src/class/midi/midi_device.c \
shared-bindings/usb_midi/__init__.c \
shared-bindings/usb_midi/PortIn.c \
shared-bindings/usb_midi/PortOut.c \
shared-module/usb_midi/__init__.c \
shared-module/usb_midi/PortIn.c \
shared-module/usb_midi/PortOut.c
endif
CFLAGS += -DUSB_AVAILABLE CFLAGS += -DUSB_AVAILABLE
endif endif