@@ -149,6 +149,18 @@ typedef struct {
149
149
uint8_t maxPower ;
150
150
} ConfigDescriptor ;
151
151
152
+ // Device Qualifier (only needed for USB2.0 devices)
153
+ typedef struct {
154
+ uint8_t bLength ;
155
+ uint8_t dtype ;
156
+ uint16_t bDescriptorType ;
157
+ uint8_t bDeviceClass ;
158
+ uint8_t bDeviceSubClass ;
159
+ uint8_t bDeviceProtocol ;
160
+ uint8_t bMaxPacketSize0 ;
161
+ uint8_t bNumConfigurations ;
162
+ } QualifierDescriptor ;
163
+
152
164
// String
153
165
154
166
// Interface
@@ -257,16 +269,16 @@ _Pragma("pack()")
257
269
{ 18, 1, 0x200, _class,_subClass,_proto,_packetSize0,_vid,_pid,_version,_im,_ip,_is,_configs }
258
270
259
271
#define D_CONFIG (_totalLength ,_interfaces ) \
260
- { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_SELF_POWERED, USB_CONFIG_POWER_MA(500) }
272
+ { 9, 2, (uint16_t)( _totalLength) ,_interfaces, 1, 0, USB_CONFIG_SELF_POWERED, USB_CONFIG_POWER_MA(500) }
261
273
262
274
#define D_OTHERCONFIG (_totalLength ,_interfaces ) \
263
- { 9, 7, _totalLength,_interfaces, 1, 0, USB_CONFIG_SELF_POWERED, USB_CONFIG_POWER_MA(500) }
275
+ { 9, 7, (uint16_t)( _totalLength) ,_interfaces, 1, 0, USB_CONFIG_SELF_POWERED, USB_CONFIG_POWER_MA(500) }
264
276
265
277
#define D_INTERFACE (_n ,_numEndpoints ,_class ,_subClass ,_protocol ) \
266
278
{ 9, 4, _n, 0, _numEndpoints, _class,_subClass, _protocol, 0 }
267
279
268
280
#define D_ENDPOINT (_addr ,_attr ,_packetSize , _interval ) \
269
- { 7, 5, _addr,_attr,_packetSize, _interval }
281
+ { 7, 5, (uint8_t)( _addr) ,_attr,_packetSize, _interval }
270
282
271
283
#define D_QUALIFIER (_class ,_subClass ,_proto ,_packetSize0 ,_configs ) \
272
284
{ 10, 6, 0x200, _class,_subClass,_proto,_packetSize0,_configs }
0 commit comments