@@ -323,13 +323,16 @@ def strings_in_order(cls):
323
323
standard .EndpointDescriptor (
324
324
description = "MIDI data out to {}" .format (args .interface_name ),
325
325
bEndpointAddress = args .midi_ep_num_out | standard .EndpointDescriptor .DIRECTION_OUT ,
326
- bmAttributes = standard .EndpointDescriptor .TYPE_BULK ),
326
+ bmAttributes = standard .EndpointDescriptor .TYPE_BULK ,
327
+ bInterval = 0 ,
328
+ wMaxPacketSize = 512 if args .highspeed else 64 ),
327
329
midi .DataEndpointDescriptor (baAssocJack = [midi_in_jack_emb ]),
328
330
standard .EndpointDescriptor (
329
331
description = "MIDI data in from {}" .format (args .interface_name ),
330
332
bEndpointAddress = args .midi_ep_num_in | standard .EndpointDescriptor .DIRECTION_IN ,
331
333
bmAttributes = standard .EndpointDescriptor .TYPE_BULK ,
332
- bInterval = 0x0 ),
334
+ bInterval = 0x0 ,
335
+ wMaxPacketSize = 512 if args .highspeed else 64 ),
333
336
midi .DataEndpointDescriptor (baAssocJack = [midi_out_jack_emb ]),
334
337
])
335
338
@@ -544,15 +547,15 @@ def strings_in_order(cls):
544
547
#include <stdint.h>
545
548
546
549
extern const uint8_t usb_desc_dev[{device_length}];
547
- // Make sure the control buffer is big enough to fit the descriptor.
548
- #define CFG_TUD_ENUM_BUFFER_SIZE {max_configuration_length}
549
550
extern const uint8_t usb_desc_cfg[{configuration_length}];
550
551
extern uint16_t usb_serial_number[{serial_number_length}];
551
552
extern uint16_t const * const string_desc_arr [{string_descriptor_length}];
552
553
553
554
extern const uint8_t hid_report_descriptor[{hid_report_descriptor_length}];
554
555
555
- #define USB_HID_NUM_DEVICES {hid_num_devices}
556
+ #define CFG_TUSB_RHPORT0_MODE ({rhport0_mode})
557
+
558
+ #define USB_HID_NUM_DEVICES {hid_num_devices}
556
559
557
560
// Vendor name included in Inquiry response, max 8 bytes
558
561
#define CFG_TUD_MSC_VENDOR "{msc_vendor}"
@@ -567,6 +570,7 @@ def strings_in_order(cls):
567
570
max_configuration_length = max (hid_descriptor_length , descriptor_length ),
568
571
string_descriptor_length = len (pointers_to_strings ),
569
572
hid_report_descriptor_length = len (bytes (combined_hid_report_descriptor )),
573
+ rhport0_mode = 'OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED' if args .highspeed else 'OPT_MODE_DEVICE' ,
570
574
hid_num_devices = len (args .hid_devices ),
571
575
msc_vendor = args .manufacturer [:8 ],
572
576
msc_product = args .product [:16 ]))
0 commit comments