File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
usb/device/targets/TARGET_Freescale Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -411,11 +411,23 @@ void USBPhyHw::endpoint_remove(usb_ep_t endpoint)
411
411
412
412
void USBPhyHw::endpoint_stall (usb_ep_t endpoint)
413
413
{
414
- USB0->ENDPOINT [DESC_TO_LOG (endpoint)].ENDPT |= USB_ENDPT_EPSTALL_MASK;
414
+ if (DESC_TO_LOG (endpoint) == 0 ) {
415
+ USB0->ENDPOINT [DESC_TO_LOG (endpoint)].ENDPT |= USB_ENDPT_EPSTALL_MASK;
416
+ } else {
417
+ uint8_t dir = DESC_EP_IN (endpoint) ? TX : RX;
418
+ uint32_t idx = EP_BDT_IDX (DESC_TO_LOG (endpoint), dir, 0 );
419
+ bdt[idx].info |= BD_OWN_MASK | BD_STALL_MASK;
420
+ }
415
421
}
416
422
417
423
void USBPhyHw::endpoint_unstall (usb_ep_t endpoint)
418
424
{
425
+
426
+ if (DESC_TO_LOG (endpoint) != 0 ) {
427
+ uint8_t dir = DESC_EP_IN (endpoint) ? TX : RX;
428
+ uint32_t idx = EP_BDT_IDX (DESC_TO_LOG (endpoint), dir, 0 );
429
+ bdt[idx].info &= ~(BD_OWN_MASK | BD_STALL_MASK);
430
+ }
419
431
USB0->ENDPOINT [DESC_TO_LOG (endpoint)].ENDPT &= ~USB_ENDPT_EPSTALL_MASK;
420
432
}
421
433
You can’t perform that action at this time.
0 commit comments