Skip to content

Commit

Permalink
sn32: Fixed USB sending errors under certain conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
dexter93 committed Jun 14, 2023
1 parent a224be1 commit 3e20119
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ void usb_serve_endpoints(USBDriver* usbp, usbep_t ep, bool in) {
/* IN endpoint, transmission.*/
USBInEndpointState *isp = epcp->in_state;

if (isp->txcnt >= isp->txsize) {
/* Transfer completed, invokes the callback.*/
_usb_isr_invoke_in_cb(usbp, ep);
return;
}

isp->txcnt += isp->txlast;
n = isp->txsize - isp->txcnt;

Expand Down

0 comments on commit 3e20119

Please sign in to comment.