mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-25 10:43:44 +00:00
implement dcd_edpt_stall
This commit is contained in:
parent
5dc04887e2
commit
552cc3ef33
@ -215,7 +215,12 @@ bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t
|
||||
void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
|
||||
{
|
||||
(void) rhport;
|
||||
(void) ep_addr;
|
||||
|
||||
uint8_t const epnum = tu_edpt_number(ep_addr);
|
||||
// uint8_t const dir = tu_edpt_dir(ep_addr);
|
||||
|
||||
// Set force stall bit
|
||||
UDP->UDP_CSR[epnum] |= UDP_CSR_FORCESTALL_Msk;
|
||||
}
|
||||
|
||||
// clear stall, data toggle is also reset to DATA0
|
||||
@ -302,6 +307,12 @@ void dcd_isr(uint8_t rhport)
|
||||
// Clear DATA Bank0 bit
|
||||
UDP->UDP_CSR[0] &= ~UDP_CSR_RX_DATA_BK0_Msk;
|
||||
}
|
||||
|
||||
// Stall sent to host
|
||||
if (UDP->UDP_CSR[epnum] & UDP_CSR_STALLSENT_Msk)
|
||||
{
|
||||
UDP->UDP_CSR[0] &= ~UDP_CSR_STALLSENT_Msk;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user