Skip to content

Commit aebee2d

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

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

shared-module/storage/__init__.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ static const uint8_t usb_msc_descriptor_template[] = {
6363
0xFF, // 11 bEndpointAddress (IN/D2H) [SET AT RUNTIME: 0x80 | number]
6464
#define MSC_IN_ENDPOINT_INDEX (11)
6565
0x02, // 12 bmAttributes (Bulk)
66-
#if USB_HIGHSPEED
66+
#if USB_HIGHSPEED
6767
0x00, 0x02, // 13,14 wMaxPacketSize 512
68-
#else
68+
#else
6969
0x40, 0x00, // 13,14 wMaxPacketSize 64
70-
#endif
70+
#endif
7171
0x00, // 15 bInterval 0 (unit depends on device speed)
7272

7373
// MSC Endpoint OUT Descriptor
@@ -76,11 +76,11 @@ static const uint8_t usb_msc_descriptor_template[] = {
7676
0xFF, // 18 bEndpointAddress (OUT/H2D) [SET AT RUNTIME]
7777
#define MSC_OUT_ENDPOINT_INDEX (18)
7878
0x02, // 19 bmAttributes (Bulk)
79-
#if USB_HIGHSPEED
79+
#if USB_HIGHSPEED
8080
0x00, 0x02, // 20,21 wMaxPacketSize 512
81-
#else
81+
#else
8282
0x40, 0x00, // 20,21 wMaxPacketSize 64
83-
#endif
83+
#endif
8484
0x00, // 22 bInterval 0 (unit depends on device speed)
8585
};
8686

shared-module/usb_cdc/__init__.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ static const uint8_t usb_cdc_descriptor_template[] = {
121121
0xFF, // 54 bEndpointAddress (OUT/H2D) [SET AT RUNTIME]
122122
#define CDC_DATA_OUT_ENDPOINT_INDEX 54
123123
0x02, // 55 bmAttributes (Bulk)
124-
#if USB_HIGHSPEED
124+
#if USB_HIGHSPEED
125125
0x00, 0x02, // 56,57 wMaxPacketSize 512
126-
#else
126+
#else
127127
0x40, 0x00, // 56,57 wMaxPacketSize 64
128-
#endif
128+
#endif
129129
0x00, // 58 bInterval 0 (unit depends on device speed)
130130

131131
// CDC Data IN Endpoint Descriptor
@@ -134,11 +134,11 @@ static const uint8_t usb_cdc_descriptor_template[] = {
134134
0xFF, // 61 bEndpointAddress (IN/D2H) [SET AT RUNTIME: 0x80 | number]
135135
#define CDC_DATA_IN_ENDPOINT_INDEX 61
136136
0x02, // 62 bmAttributes (Bulk)
137-
#if USB_HIGHSPEED
137+
#if USB_HIGHSPEED
138138
0x00, 0x02, // 63,64 wMaxPacketSize 512
139-
#else
139+
#else
140140
0x40, 0x00, // 63,64 wMaxPacketSize 64
141-
#endif
141+
#endif
142142
0x00, // 65 bInterval 0 (unit depends on device speed)
143143
};
144144

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)