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

Fixed usb read loops not reading until timeout #16827

Merged
merged 1 commit into from
Apr 9, 2022
Merged

Fixed usb read loops not reading until timeout #16827

merged 1 commit into from
Apr 9, 2022

Conversation

susch19
Copy link

@susch19 susch19 commented Apr 9, 2022

Description

The size variable was redeclared inside the do while in chibios usb main reading tasks. Therefore the outside variable, that was used in the while check was not assigned the new value. So it was always a do{} while(false) loop and the compiler removed it. I guess the original intention of the author was to read the data, until the size 0 was returned, and all data was read.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

* the size variable was redeclared (hiding the variable of the outside scope) and therefore the while check was always false, so the compiler just removed the do while loop, but it would be better to read all data and only exit the task, after this is done
@github-actions github-actions bot added the core label Apr 9, 2022
Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

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

Thanks! You are right, this bug exists since the code was introduced in #2362

@KarlK90 KarlK90 requested a review from a team April 9, 2022 22:03
@KarlK90 KarlK90 merged commit bf67abb into qmk:develop Apr 9, 2022
0xcharly pushed a commit to Bastardkb/bastardkb-qmk that referenced this pull request Jul 4, 2022
* the size variable was redeclared (hiding the variable of the outside scope) and therefore the while check was always false, so the compiler just removed the do while loop, but it would be better to read all data and only exit the task, after this is done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants