Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RP2040] usb: fix usb_lld_get_status functions #383

Merged

Conversation

KarlK90
Copy link
Contributor

@KarlK90 KarlK90 commented Nov 25, 2023

This fixes the USB endpoint get status functions; previously the (wrong) assumptions were the following:

  • active was toggled depending on whether a transaction was currently ongoing on the endpoint e.g., if the endpoint is "busy." What is actually requested is if this endpoint is enabled at all. Therefore, we check the enabled flag in the endpoint control register.
  • stalled was toggled by the device itself, although this property is completely controlled by the host via the SET and CLEAR feature requests. Therefore, we check the stalled flag in the endpoint buffer control register.

This fixes the USB endpoint get status functions; previously the
(wrong) assumptions were the following:

* `active` was toggled depending on whether a transaction was currently
  ongoing on the endpoint e.g., if the endpoint is "busy." What is  
  actually requested is if this endpoint is enabled at all. Therefore,
  we check the `enabled` flag in the endpoint control register.
* `stalled` was toggled by the device itself, although this property is
  completely controlled by the host via the SET and CLEAR feature
  requests. Therefore, we check the `stalled` flag in the endpoint
  buffer control register.
@KarlK90 KarlK90 force-pushed the fix/rp2040-usb-get-status-request branch from c05ef9e to 1a1bbe6 Compare November 25, 2023 00:19
@fpoussin fpoussin merged commit 7011993 into ChibiOS:chibios-21.11.x Nov 27, 2023
1 check failed
@fpoussin
Copy link
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants