Skip to content

Remove gamepad, swap with keypad #28

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

Merged
merged 13 commits into from
Nov 20, 2021
Merged

Remove gamepad, swap with keypad #28

merged 13 commits into from
Nov 20, 2021

Conversation

tekktrik
Copy link
Member

Some additional infrastructure and linting changes as well, but most of the work is shifting (pun intended) away from gamepad's GamePadShift class to keypad's ShiftRegisterKeys. I'm now storing the button states in _pad_states as a byte to keep track of the event changes, modified using the new method _store_button_states(). This eliminates the need for _check_cursor_movement to take an input argument. I've also changed the PYBADGE constants for represent bit indexes/event key numbers for easier bit manipulation.

I didn't have the hardware to test this, so I'd appreciate it if someone could! Otherwise I should be able to get a Feather M4 Express and a shift register and try and mimic the behavior soon enough, if that will work.

@tekktrik
Copy link
Member Author

tekktrik commented Nov 15, 2021

This PR is meant to address Issue #23, which I forgot to tag.

@tannewt tannewt requested a review from a team November 15, 2021 18:16
@tekktrik
Copy link
Member Author

Thanks for the review @deshipu, changes made! Also threw in a change to swap a throwaway to an underscore that I missed the first time.

@FoamyGuy
Copy link
Contributor

I get this error attempting to run the simpletest on a PyGamer with Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit PyGamer with samd51j19

code.py output:
Traceback (most recent call last):
  File "code.py", line 26, in <module>
  File "/lib/adafruit_cursorcontrol/cursorcontrol_cursormanager.py", line 103, in update
TypeError: event must of type Event

Code done running.

@tekktrik
Copy link
Member Author

@FoamyGuy ah, I forgot to init self._event as an Event instead of None. Changes made! Also added self._event to the deinit method.

@tekktrik
Copy link
Member Author

Tested with EdgeBadge on 7.0.0, all the example code runs great! Also ran the DebouncedCursorManager and it works!

@FoamyGuy
Copy link
Contributor

@tekktrik thanks for working on this and doing some testing. I've got this on my list of things to look into and test again today, I will get back to it a bit later on this afternoon, and will get it merged after I take a look if all is well.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

looks good to me. tested successfully with pygamer 7.0.0

@FoamyGuy FoamyGuy merged commit 826e187 into adafruit:main Nov 20, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Nov 20, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol to 0.6.0 from 0.5.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP_ATcontrol#49 from mperino/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_CursorControl to 2.5.0 from 2.4.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_CursorControl#28 from tekktrik/hotfix/remove-gamepad

Updating https://github.com/adafruit/Adafruit_CircuitPython_datetime to 1.1.5 from 1.1.4:
  > Fixed requirements.txt

Updating https://github.com/adafruit/Adafruit_CircuitPython_FunHouse to 2.1.6 from 2.1.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_FunHouse#24 from tekktrik/feature/add-typing

Updating https://github.com/adafruit/Adafruit_CircuitPython_Logging to 3.7.2 from 3.7.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#24 from tekktrik/docfix/add-repo-version-info

Updating https://github.com/adafruit/Adafruit_CircuitPython_RGBLED to 1.1.8 from 1.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_RGBLED#18 from adafruit/patch-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_RTTTL to 2.4.8 from 2.4.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_RTTTL#25 from tekktrik/feature/add-typing

Updating https://github.com/adafruit/Adafruit_CircuitPython_SimpleMath to 2.0.2 from 2.0.1:
  > Fixed requirements file
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.

3 participants