mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-07 05:54:11 +08:00
debugging can be configured on renesas hcd
This commit is contained in:
parent
1923b1845d
commit
41b608562a
@ -41,6 +41,8 @@
|
|||||||
#error "Unsupported MCU"
|
#error "Unsupported MCU"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define TU_RUSB2_HCD_DBG 0
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
|
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
@ -409,7 +411,7 @@ static void process_pipe_nrdy(uint8_t rhport, unsigned num)
|
|||||||
(void)rhport;
|
(void)rhport;
|
||||||
xfer_result_t result;
|
xfer_result_t result;
|
||||||
uint16_t volatile *ctr = get_pipectr(num);
|
uint16_t volatile *ctr = get_pipectr(num);
|
||||||
// TU_LOG1("NRDY %d %x\n", num, *ctr);
|
TU_LOG(TU_RUSB2_HCD_DBG, "NRDY %d %x\n", num, *ctr);
|
||||||
switch (*ctr & RUSB2_PIPE_CTR_PID_Msk) {
|
switch (*ctr & RUSB2_PIPE_CTR_PID_Msk) {
|
||||||
default: return;
|
default: return;
|
||||||
case RUSB2_PIPE_CTR_PID_STALL: result = XFER_RESULT_STALLED; break;
|
case RUSB2_PIPE_CTR_PID_STALL: result = XFER_RESULT_STALLED; break;
|
||||||
@ -442,7 +444,7 @@ static void process_pipe_brdy(uint8_t rhport, unsigned num)
|
|||||||
hcd_event_xfer_complete(pipe->dev, pipe->ep,
|
hcd_event_xfer_complete(pipe->dev, pipe->ep,
|
||||||
pipe->length - pipe->remaining,
|
pipe->length - pipe->remaining,
|
||||||
XFER_RESULT_SUCCESS, true);
|
XFER_RESULT_SUCCESS, true);
|
||||||
// TU_LOG1("C %d %d\r\n", num, pipe->length - pipe->remaining);
|
TU_LOG(TU_RUSB2_HCD_DBG, "C %d %d\r\n", num, pipe->length - pipe->remaining);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -609,7 +611,7 @@ void hcd_device_close(uint8_t rhport, uint8_t dev_addr)
|
|||||||
bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet[8])
|
bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet[8])
|
||||||
{
|
{
|
||||||
(void)rhport;
|
(void)rhport;
|
||||||
// TU_LOG1("S %d %x\n", dev_addr, RUSB2->DCPCTR);
|
TU_LOG(TU_RUSB2_HCD_DBG, "S %d %x\n", dev_addr, RUSB2->DCPCTR);
|
||||||
|
|
||||||
TU_ASSERT(dev_addr < 6); /* USBa can only handle addresses from 0 to 5. */
|
TU_ASSERT(dev_addr < 6); /* USBa can only handle addresses from 0 to 5. */
|
||||||
TU_ASSERT(0 == RUSB2->DCPCTR_b.SUREQ);
|
TU_ASSERT(0 == RUSB2->DCPCTR_b.SUREQ);
|
||||||
@ -702,7 +704,7 @@ bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t *b
|
|||||||
{
|
{
|
||||||
bool r;
|
bool r;
|
||||||
hcd_int_disable(rhport);
|
hcd_int_disable(rhport);
|
||||||
// TU_LOG1("X %d %x %u\n", dev_addr, ep_addr, buflen);
|
TU_LOG(TU_RUSB2_HCD_DBG, "X %d %x %u\n", dev_addr, ep_addr, buflen);
|
||||||
r = process_edpt_xfer(dev_addr, ep_addr, buffer, buflen);
|
r = process_edpt_xfer(dev_addr, ep_addr, buffer, buflen);
|
||||||
hcd_int_enable(rhport);
|
hcd_int_enable(rhport);
|
||||||
return r;
|
return r;
|
||||||
@ -746,7 +748,7 @@ void hcd_int_handler(uint8_t rhport)
|
|||||||
/* clear active bits except VALID (don't write 0 to already cleared bits according to the HW manual) */
|
/* clear active bits except VALID (don't write 0 to already cleared bits according to the HW manual) */
|
||||||
RUSB2->INTSTS1 = ~((RUSB2_INTSTS1_SACK_Msk | RUSB2_INTSTS1_SIGN_Msk | RUSB2_INTSTS1_ATTCH_Msk | RUSB2_INTSTS1_DTCH_Msk) & is1);
|
RUSB2->INTSTS1 = ~((RUSB2_INTSTS1_SACK_Msk | RUSB2_INTSTS1_SIGN_Msk | RUSB2_INTSTS1_ATTCH_Msk | RUSB2_INTSTS1_DTCH_Msk) & is1);
|
||||||
RUSB2->INTSTS0 = ~((RUSB2_INTSTS0_BRDY_Msk | RUSB2_INTSTS0_NRDY_Msk | RUSB2_INTSTS0_BEMP_Msk) & is0);
|
RUSB2->INTSTS0 = ~((RUSB2_INTSTS0_BRDY_Msk | RUSB2_INTSTS0_NRDY_Msk | RUSB2_INTSTS0_BEMP_Msk) & is0);
|
||||||
// TU_LOG1("IS %04x %04x\n", is0, is1);
|
TU_LOG(TU_RUSB2_HCD_DBG, "IS %04x %04x\n", is0, is1);
|
||||||
is1 &= RUSB2->INTENB1;
|
is1 &= RUSB2->INTENB1;
|
||||||
is0 &= RUSB2->INTENB0;
|
is0 &= RUSB2->INTENB0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user