8000 Handle USB_HIGHSPEED for MIDI also · adafruit/circuitpython@a6090d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit a6090d2

Browse files
committed
Handle USB_HIGHSPEED for MIDI also
1 parent da248d1 commit a6090d2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

shared-module/usb_midi/__init__.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ static const uint8_t usb_midi_descriptor_template[] = {
127127
0xFF, // 66 bEndpointAddress (OUT/H2D) [SET AT RUNTIME]
128128
#define MIDI_STREAMING_OUT_ENDPOINT_INDEX (66)
129129
0x02, // 67 bmAttributes (Bulk)
130+
#if USB_HIGHSPEED
131+
0x00, 0x02, // 68,69 wMaxPacketSize (512)
132+
#else
130133
0x40, 0x00, // 68,69 wMaxPacketSize (64)
134+
#endif
131135
0x00, // 70 bInterval 0 (unit depends on device speed)
132136

133137
// MIDI Data Endpoint Descriptor
@@ -143,7 +147,11 @@ static const uint8_t usb_midi_descriptor_template[] = {
143147
0xFF, // 78 bEndpointAddress (IN/D2H) [SET AT RUNTIME: 0x80 | number]
144148
#define MIDI_STREAMING_IN_ENDPOINT_INDEX (78)
145149
0x02, // 79 bmAttributes (Bulk)
146-
0x40, 0x00, // 8081 wMaxPacketSize 64
150+
#if USB_HIGHSPEED
151+
0x00, 0x02, // 80, 81 wMaxPacketSize (512)
152+
#else
153+
0x40, 0x00, // 80, 81 wMaxPacketSize (64)
154+
#endif
147155
0x00, // 82 bInterval 0 (unit depends on device speed)
148156

149157
// MIDI Data Endpoint Descriptor

0 commit comments

Comments
 (0)
0