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

refactor keypad to share more code; fix initial keys pressed #6248

Merged
merged 2 commits into from
Apr 6, 2022

Conversation

jepler
Copy link
Member

@jepler jepler commented Apr 5, 2022

This saves 444 bytes on the pygamer build (both commits taken together)

testing performed:

  • pygamer (samd51) with ShiftRegisterKeys
  • macropad (rp2040) with Keys
  • UM feather s2 (esp32-s2) with KeyMatrix

Result:

  • all ports still worked nicely
  • keys held down at start always registered (>2 trials all boards, >100 trials esp32-s2)
  • keys held down are immediately registered after reset() (>100 trials esp32-s2)
  • double .reset() is OK, accessing .events after .reset() throws (only tested esp32-s2)

jepler added 2 commits April 5, 2022 14:50
This saves 444 bytes on the pygamer build (both commits taken together)

testing performed:
 * pygamer (samd51) with ShiftRegisterKeys
 * macropad (rp2040) with Keys
 * UM feather s2 (esp32-s2) with KeyMatrix

Result:
 * all ports still worked nicely
 * keys held down at start always registered (>2 trials all boards, >100 trials esp32-s2)
 * keys held down are immediately registered after reset() (>100 trials esp32-s2)
 * double .reset() is OK, accessing .events throws (only tested esp32-s2)
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Thanks for this nice refactoring, and fixing the initial state getting.

@dhalbert dhalbert merged commit 83e1b5b into adafruit:main Apr 6, 2022
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