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

Store/manage all instances of GPIOPin #59

Open
EnotionZ opened this issue Oct 1, 2018 · 1 comment
Open

Store/manage all instances of GPIOPin #59

EnotionZ opened this issue Oct 1, 2018 · 1 comment
Milestone

Comments

@EnotionZ
Copy link
Owner

EnotionZ commented Oct 1, 2018

Since gpio.open acts like a Factory pattern for a discrete number of pins, there's no reason why we shouldn't store the GPIOPin instances internally. The benefit is that gpio.close will get all the benefit of contextually closing from the instance (port.close) like killing the filewatcher or whatever else we may add in the future.

The other benefit is if a user happens to open a port that has already been opened, then we can return the GPIOPin instance immediately without trying to close and reopen.

@EnotionZ EnotionZ added this to the v1.0 milestone Oct 1, 2018
@rzr
Copy link
Collaborator

rzr commented Oct 1, 2018

Maybe we need an other object to relate system configuration.

IMHO, It would make sense to keep gpio as a "minimal" driver to get access to sysfs.

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

No branches or pull requests

2 participants