From 479b047618416495be1505c111859e385c51be48 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 4 Sep 2019 13:58:18 -0400 Subject: [PATCH] Reverted descriptor changes pending HID restructuring --- ports/stm32f4/common-hal/busio/I2C.c | 4 ++-- supervisor/supervisor.mk | 3 +-- tools/gen_usb_descriptor.py | 9 +++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/I2C.c b/ports/stm32f4/common-hal/busio/I2C.c index 019465cccd..4d5675127e 100644 --- a/ports/stm32f4/common-hal/busio/I2C.c +++ b/ports/stm32f4/common-hal/busio/I2C.c @@ -37,8 +37,8 @@ I2C_HandleTypeDef hi2c2; void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint32_t frequency, uint32_t timeout) { - //TODO: Rework this entire section to use LL, alongside MSP removal - + //TODO: Rework this entire section to use LL so we can properly assign pins + // This will also be bundled with MSP removal hi2c2.Instance = I2C1; hi2c2.Init.ClockSpeed = 100000; hi2c2.Init.DutyCycle = I2C_DUTYCYCLE_2; diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 19516a30ff..0406dcf927 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -104,8 +104,7 @@ autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile --pid $(USB_PID)\ --serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\ --output_c_file $(BUILD)/autogen_usb_descriptor.c\ - --output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h\ - --cdc_and_msc_only $(USB_CDC_AND_MSC_ONLY) + --output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h CIRCUITPY_DISPLAY_FONT ?= "../../tools/fonts/ter-u12n.bdf" diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index 6fb33a77af..10bbf50663 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -21,7 +21,6 @@ parser.add_argument('--serial_number_length', type=int, default=32, help='length needed for the serial number in digits') parser.add_argument('--output_c_file', type=argparse.FileType('w'), required=True) parser.add_argument('--output_h_file', type=argparse.FileType('w'), required=True) -parser.add_argument('--cdc_and_msc_only', nargs='?',const=0, type=int) args = parser.parse_args() @@ -132,7 +131,7 @@ msc_interfaces = [ bInterval=0), standard.EndpointDescriptor( description="MSC out", - bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT, + bEndpointAddress=0x1 | standard.EndpointDescriptor.DIRECTION_OUT, bmAttributes=standard.EndpointDescriptor.TYPE_BULK, bInterval=0) ] @@ -277,16 +276,14 @@ descriptor_list.extend(cdc_interfaces) descriptor_list.extend(msc_interfaces) # Only add the control interface because other audio interfaces are managed by it to ensure the # correct ordering. -if not args.cdc_and_msc_only: - descriptor_list.append(audio_control_interface) +descriptor_list.append(audio_control_interface) # Put the CDC IAD just before the CDC interfaces. # There appears to be a bug in the Windows composite USB driver that requests the # HID report descriptor with the wrong interface number if the HID interface is not given # first. However, it still fetches the descriptor anyway. We could reorder the interfaces but # the Windows 7 Adafruit_usbser.inf file thinks CDC is at Interface 0, so we'll leave it # there for backwards compatibility. -if not args.cdc_and_msc_only: - descriptor_list.extend(hid_interfaces) +descriptor_list.extend(hid_interfaces) configuration = standard.ConfigurationDescriptor( description="Composite configuration",