@@ -149,6 +149,18 @@ typedef struct {
149149 uint8_t maxPower ;
150150} ConfigDescriptor ;
151151
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+
152164// String
153165
154166// Interface
@@ -257,16 +269,16 @@ _Pragma("pack()")
257269 { 18, 1, 0x200, _class,_subClass,_proto,_packetSize0,_vid,_pid,_version,_im,_ip,_is,_configs }
258270
259271#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) }
261273
262274#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) }
264276
265277#define D_INTERFACE (_n ,_numEndpoints ,_class ,_subClass ,_protocol ) \
266278 { 9, 4, _n, 0, _numEndpoints, _class,_subClass, _protocol, 0 }
267279
268280#define D_ENDPOINT (_addr ,_attr ,_packetSize , _interval ) \
269- { 7, 5, _addr,_attr,_packetSize, _interval }
281+ { 7, 5, (uint8_t)( _addr) ,_attr,_packetSize, _interval }
270282
271283#define D_QUALIFIER (_class ,_subClass ,_proto ,_packetSize0 ,_configs ) \
272284 { 10, 6, 0x200, _class,_subClass,_proto,_packetSize0,_configs }
0 commit comments