@@ -291,6 +291,9 @@ bool tuh_vid_pid_get(uint8_t dev_addr, uint16_t *vid, uint16_t *pid) {
291291 * vid = dev -> vid ;
292292 * pid = dev -> pid ;
293293
294+ TU_LOG_HEX_USBH (* vid );
295+ TU_LOG_HEX_USBH (* pid );
296+
294297 return true;
295298}
296299
@@ -340,12 +343,12 @@ bool tuh_init(uint8_t controller_id) {
340343 if ( tuh_inited () ) return true;
341344
342345 TU_LOG_USBH ("USBH init on controller %u\r\n" , controller_id );
343- TU_LOG_INT ( CFG_TUH_LOG_LEVEL , sizeof (usbh_device_t ));
344- TU_LOG_INT ( CFG_TUH_LOG_LEVEL , sizeof (hcd_event_t ));
345- TU_LOG_INT ( CFG_TUH_LOG_LEVEL , sizeof (_ctrl_xfer ));
346- TU_LOG_INT ( CFG_TUH_LOG_LEVEL , sizeof (tuh_xfer_t ));
347- TU_LOG_INT ( CFG_TUH_LOG_LEVEL , sizeof (tu_fifo_t ));
348- TU_LOG_INT ( CFG_TUH_LOG_LEVEL , sizeof (tu_edpt_stream_t ));
346+ TU_LOG_INT_USBH ( sizeof (usbh_device_t ));
347+ TU_LOG_INT_USBH ( sizeof (hcd_event_t ));
348+ TU_LOG_INT_USBH ( sizeof (_ctrl_xfer ));
349+ TU_LOG_INT_USBH ( sizeof (tuh_xfer_t ));
350+ TU_LOG_INT_USBH ( sizeof (tu_fifo_t ));
351+ TU_LOG_INT_USBH ( sizeof (tu_edpt_stream_t ));
349352
350353 // Event queue
351354 _usbh_q = osal_queue_create ( & _usbh_qdef );
@@ -589,7 +592,7 @@ bool tuh_control_xfer (tuh_xfer_t* xfer) {
589592 TU_LOG_USBH ("[%u:%u] %s: " , rhport , daddr ,
590593 (xfer -> setup -> bmRequestType_bit .type == TUSB_REQ_TYPE_STANDARD && xfer -> setup -> bRequest <= TUSB_REQ_SYNCH_FRAME ) ?
591594 tu_str_std_request [xfer -> setup -> bRequest ] : "Class Request" );
592- TU_LOG_BUF ( CFG_TUH_LOG_LEVEL , xfer -> setup , 8 );
595+ TU_LOG_BUF_USBH ( xfer -> setup , 8 );
593596 TU_LOG_USBH ("\r\n" );
594597
595598 if (xfer -> complete_cb ) {
@@ -665,9 +668,9 @@ static bool usbh_control_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result
665668 tusb_control_request_t const * request = & _ctrl_xfer .request ;
666669
667670 if (XFER_RESULT_SUCCESS != result ) {
668- TU_LOG1 ("[%u:%u] Control %s, xferred_bytes = %lu\r\n" , rhport , dev_addr , result == XFER_RESULT_STALLED ? "STALLED" : "FAILED" , xferred_bytes );
669- TU_LOG1_BUF (request , 8 );
670- TU_LOG1 ("\r\n" );
671+ TU_LOG_USBH ("[%u:%u] Control %s, xferred_bytes = %lu\r\n" , rhport , dev_addr , result == XFER_RESULT_STALLED ? "STALLED" : "FAILED" , xferred_bytes );
672+ TU_LOG_BUF_USBH (request , 8 );
673+ TU_LOG_USBH ("\r\n" );
671674
672675 // terminate transfer if any stage failed
673676 _xfer_complete (dev_addr , result );
@@ -685,7 +688,7 @@ static bool usbh_control_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result
685688 case CONTROL_STAGE_DATA :
686689 if (request -> wLength ) {
687690 TU_LOG_USBH ("[%u:%u] Control data:\r\n" , rhport , dev_addr );
688- TU_LOG_MEM ( CFG_TUH_LOG_LEVEL , _ctrl_xfer .buffer , xferred_bytes , 2 );
691+ TU_LOG_MEM_USBH ( _ctrl_xfer .buffer , xferred_bytes , 2 );
689692 }
690693
691694 _ctrl_xfer .actual_len = (uint16_t ) xferred_bytes ;
@@ -860,7 +863,7 @@ bool usbh_edpt_xfer_with_callback(uint8_t dev_addr, uint8_t ep_addr, uint8_t * b
860863 // HCD error, mark endpoint as ready to allow next transfer
861864 ep_state -> busy = 0 ;
862865 ep_state -> claimed = 0 ;
863- TU_LOG1 ("Failed\r\n" );
866+ TU_LOG_USBH ("Failed\r\n" );
864867// TU_BREAKPOINT();
865868 return false;
866869 }
@@ -1318,7 +1321,7 @@ static void process_enumeration(tuh_xfer_t* xfer) {
13181321 if ( retry ) {
13191322 failed_count ++ ;
13201323 osal_task_delay (ATTEMPT_DELAY_MS ); // delay a bit
1321- TU_LOG1 ("Enumeration attempt %u\r\n" , failed_count );
1324+ TU_LOG_USBH ("Enumeration attempt %u\r\n" , failed_count );
13221325 retry = tuh_control_xfer (xfer );
13231326 }
13241327
0 commit comments