File tree 1 file changed +6
-3
lines changed
libraries/USBHost/examples/USB_desc
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -340,16 +340,19 @@ void printHIDdescr( uint8_t* descr_ptr )
340
340
/* function to print endpoint descriptor */
341
341
void printepdescr ( uint8_t * descr_ptr )
342
342
{
343
+ uint8_t transfer_type;
344
+
343
345
USB_ENDPOINT_DESCRIPTOR* ep_ptr = ( USB_ENDPOINT_DESCRIPTOR* )descr_ptr;
344
346
printProgStr (End_Header_str);
345
347
printProgStr (End_Address_str);
346
348
if ( 0x80 & ep_ptr->bEndpointAddress ) printProgStr (PSTR (" IN\t\t " ));
347
349
else printProgStr (PSTR (" OUT\t\t " ));
348
350
print_hex ( (ep_ptr->bEndpointAddress & 0xF ), 8 );
349
351
printProgStr (End_Attr_str);
350
- if ( 0x03 & ep_ptr->bmAttributes ) printProgStr (PSTR (" INTERRUPT\t " ));
351
- else if ( 0x02 & ep_ptr->bmAttributes ) printProgStr (PSTR (" BULK\t " ));
352
- else if ( 0x01 & ep_ptr->bmAttributes ) printProgStr (PSTR (" ISO\t " ));
352
+ transfer_type = ep_ptr->bmAttributes & bmUSB_TRANSFER_TYPE;
353
+ if ( transfer_type == USB_TRANSFER_TYPE_INTERRUPT ) printProgStr (PSTR (" INTERRUPT\t " ));
354
+ else if ( transfer_type == USB_TRANSFER_TYPE_BULK ) printProgStr (PSTR (" BULK\t " ));
355
+ else if ( transfer_type == USB_TRANSFER_TYPE_ISOCHRONOUS ) printProgStr (PSTR (" ISO\t " ));
353
356
print_hex ( ep_ptr->bmAttributes , 8 );
354
357
printProgStr (End_Pktsize_str);
355
358
print_hex ( ep_ptr->wMaxPacketSize , 16 );
You can’t perform that action at this time.
0 commit comments