explicitly clear stall and data toggle for edpoint upon open()
This commit is contained in:
parent
81c73c235f
commit
8bad0af849
|
@ -306,8 +306,9 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
|
||||||
{
|
{
|
||||||
(void) rhport;
|
(void) rhport;
|
||||||
|
|
||||||
uint8_t const epnum = tu_edpt_number(desc_edpt->bEndpointAddress);
|
uint8_t const ep_addr = desc_edpt->bEndpointAddress;
|
||||||
uint8_t const dir = tu_edpt_dir(desc_edpt->bEndpointAddress);
|
uint8_t const epnum = tu_edpt_number(ep_addr);
|
||||||
|
uint8_t const dir = tu_edpt_dir(ep_addr);
|
||||||
|
|
||||||
_dcd.xfer[epnum][dir].mps = desc_edpt->wMaxPacketSize.size;
|
_dcd.xfer[epnum][dir].mps = desc_edpt->wMaxPacketSize.size;
|
||||||
|
|
||||||
|
@ -359,6 +360,11 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
|
||||||
NRF_USBD->EPINEN |= USBD_EPINEN_ISOIN_Msk;
|
NRF_USBD->EPINEN |= USBD_EPINEN_ISOIN_Msk;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear stall and reset DataToggle
|
||||||
|
NRF_USBD->EPSTALL = (USBD_EPSTALL_STALL_UnStall << USBD_EPSTALL_STALL_Pos) | ep_addr;
|
||||||
|
NRF_USBD->DTOGGLE = (USBD_DTOGGLE_VALUE_Data0 << USBD_DTOGGLE_VALUE_Pos) | ep_addr;
|
||||||
|
|
||||||
__ISB(); __DSB();
|
__ISB(); __DSB();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue