In interrupt mode, calling usbd_ep_write in the main program will cause the main program to get stuck and data will never be sent.
ep_write :
if (ep != 0 && epi->DIEPCTL & USB_OTG_DIEPCTL_EPENA) return -1; // Always returns -1, epi->DIEPCTL & USB_OTG_DIEPCTL_EPENA always is 1
Tracing found that when the main function calls ep_write, the interrupt will generate EP0's ZLP, which will cause the main function's ep_write to be interrupted by EP0's ZLP, and then the data can never be sent.
How can I use the main program to call usbd_ep_write in interrupt mode?
In interrupt mode, calling usbd_ep_write in the main program will cause the main program to get stuck and data will never be sent.
ep_write :
if (ep != 0 && epi->DIEPCTL & USB_OTG_DIEPCTL_EPENA) return -1; // Always returns -1, epi->DIEPCTL & USB_OTG_DIEPCTL_EPENA always is 1
Tracing found that when the main function calls ep_write, the interrupt will generate EP0's ZLP, which will cause the main function's ep_write to be interrupted by EP0's ZLP, and then the data can never be sent.
How can I use the main program to call usbd_ep_write in interrupt mode?