-
Notifications
You must be signed in to change notification settings - Fork 2
add support for timer and clkout #6
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
Conversation
Thanks for the PR! Any idea how much memory these additions take? I wonder if we should add them with a subclass. |
Is |
Yup! Please call |
Test code is:
The new implementation uses 1840 extra bytes (after object creation), comparing py-files. BTW: pressing repeatedly CTRL-D to reload the program will result in different results. So the state does not seem to be reset deterministically. I could refactor the timer-code to a separate class and add a |
How much does it vary?
I would add a separate timer class in a separate file (in the same file it'll still be loaded into ram.) You could then have that class subclass the regular one or take it into the constructor. I wouldn't have the main class construct the timer class for you.
👍 |
As far as I remember about 1K.
The timer-class should go into a separate class for sure. But I don't see any necessity to subclass the regular one or even use an instance of it. Both the rtc-class and the timer-class are more or less facades for specific registers of an I2C-device with fixed address and the timer-class would not share or even depend on anything of the rtc-class (n.b. the timer doesn't even need a correct time to be set in the rtc). I will post an updated version of the PR for discussion. |
Sounds good! That's a good point.
Weird. That seems like a lot. I'd expect it to be pretty deterministic. |
This refactors the timer-code to it's own class. Probably the pyproject.toml needs some care too. Normally I would expect multipe files/classes within module (i.e. the adafruit_pcf8563 should be a directory), but that would break existing code. |
The CI tests fail now because of two toplevel files and recommend to merge them into a single file. Or to create a subdirectory). But as noted above, this would break the imports of existing code. |
I think making the subdirectory so that It will cause a change to the import statement in code that uses it, but we can make sure to update all of our example code at the same time, and release it with a major version number increase to indicate the incompatibility. Having two python library files in the root of the repo causes issues with other parts of the infrastructure and surrounding tools. Many of them assume it will either be single file, or folder with base name and multiple files inside. |
I fully agree. Note that a similar PR for the 8523 would probably affect far more people because of the existing PCF8523 breakout. But I don't think there is a better solution. |
Any ideas on how to reach a consensus on what to do? |
I agree with @FoamyGuy's suggestions. |
Ok, fine. So I will post a new version of the PR moving the files to a subdirectory. Once that is fine, I will also rework the PR for the 8523. |
I don't understand the problem of the CI, it states
but there is a blank linke after line 33 and it is also an area I did not touch. |
fixing docs
Is there a reason (except lack of time) why this PR is not merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this fell off my radar. Feel free to ping me if I haven't replied in over a business day.
One suggestion. Looks good otherwise and will need to be a major release.
I have removed the clokout-attributes with one exception: I left |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you!
Updating https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel_SPI to 1.0.6 from 1.0.5: > Merge pull request adafruit/Adafruit_CircuitPython_NeoPixel_SPI#36 from RossK1/adding_type_hints > Add upload url to release action > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_PCF8563 to 2.0.0 from 1.0.8: > Merge pull request adafruit/Adafruit_CircuitPython_PCF8563#6 from bablokb/4upstream > Add upload url to release action > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display to 3.11.2 from 3.11.1: > Merge pull request adafruit/Adafruit_CircuitPython_RGB_Display#113 from tekktrik/fix/typing Updating https://github.com/adafruit/Adafruit_CircuitPython_FancyLED to 1.4.15 from 1.4.14: > Merge pull request adafruit/Adafruit_CircuitPython_FancyLED#30 from SebastienFauque/feature/typingLEDs > Add upload url to release action > Add .venv to .gitignore Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
This add support for the builtin timer and for signal generation using the CLKOUT-pin