Skip to content

Commit

Permalink
sn32: attempt to fix the USB quirks
Browse files Browse the repository at this point in the history
  • Loading branch information
dexter93 committed Jun 2, 2023
1 parent a224be1 commit cbd841a
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

1 comment on commit cbd841a

@fightforlife
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dexter93 After merging this I was able to disable the idle thread and use my own sleep functions! Saving 112 Bytes of RAM oin the SN32F268 Thank you!!
Before USB would glitch as soon as using some modifiers.

Please sign in to comment.