Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor touch code to save space #34

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 2 commits into from
Jun 4, 2018
Merged

Conversation

dhalbert
Copy link
Contributor

@dhalbert dhalbert commented Jun 4, 2018

  1. Move common code for each .touch_Ax to a single routine. Use a list to keep track of what's initialized. There are no longer separate named attributes for each touch pin.
  2. Combine a duplicated line of code in ._generate_sample.
  3. Remove unnecessary __init__.py.

Saves 348 bytes in frozen CPX. (tagging @tannewt).

@dhalbert dhalbert requested a review from kattni June 4, 2018 13:51
Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for doing this!

@kattni
Copy link
Contributor

kattni commented Jun 4, 2018

Tested successfully.

@kattni kattni merged commit 862a379 into adafruit:master Jun 4, 2018
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 5, 2018
Updating https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground to 2.0.1 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#34 from dhalbert/touch_refactor

Updating https://github.com/adafruit/Adafruit_CircuitPython_IRRemote to 3.1.0 from 3.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_IRRemote#11 from apatt/master
  > Merge pull request adafruit/Adafruit_CircuitPython_IRRemote#10 from sommersoft/example_update
  > Merge pull request adafruit/Adafruit_CircuitPython_IRRemote#8 from sommersoft/new_docs
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