File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
libraries/USBHost/examples/USB_desc Expand file tree Collapse file tree 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 )
340340/* function to print endpoint descriptor */
341341void printepdescr ( uint8_t * descr_ptr )
342342{
343+ uint8_t transfer_type;
344+
343345 USB_ENDPOINT_DESCRIPTOR* ep_ptr = ( USB_ENDPOINT_DESCRIPTOR* )descr_ptr;
344346 printProgStr (End_Header_str);
345347 printProgStr (End_Address_str);
346348 if ( 0x80 & ep_ptr->bEndpointAddress ) printProgStr (PSTR (" IN\t\t " ));
347349 else printProgStr (PSTR (" OUT\t\t " ));
348350 print_hex ( (ep_ptr->bEndpointAddress & 0xF ), 8 );
349351 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 " ));
353356 print_hex ( ep_ptr->bmAttributes , 8 );
354357 printProgStr (End_Pktsize_str);
355358 print_hex ( ep_ptr->wMaxPacketSize , 16 );
You can’t perform that action at this time.
0 commit comments