Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

GreenGiant bug workaround #29

Open
WillMunns opened this issue Oct 30, 2021 · 4 comments
Open

GreenGiant bug workaround #29

WillMunns opened this issue Oct 30, 2021 · 4 comments

Comments

@WillMunns
Copy link
Contributor

Some missing break statements in the green giant code mean that configuring GPIO will also configure higher numbered GPIO.

The obvious FAQ workaround is to ask users to put inputs on the low numbered GPIO and outputs on the higher ones, then simply configure the GPIO in order.

In robot we could configure all GPIO in order whenever there is a configuration change to any GPIO. Its a little ugly but we can't patch GreenGiants that are in the wild

@WillMunns
Copy link
Contributor Author

I'm not certain how to do this cleanly. You know the GPIO number because its the address -1, but I'm not sure that the GPIO object can access its parent to use that information?

You can't use this info to query the Greengiant because the Greengiant doesn't let you know this from the I2C.

Hacky as hell you could have a static array and update from this?

@shardros
Copy link
Member

shardros commented Nov 7, 2021

I don't understand the problem enough to suggest a fix. Could you comment a passing/failing example?

Yes you can access the parent class in python using super.

@WillMunns
Copy link
Contributor Author

WillMunns commented Nov 7, 2021 via email

@shardros
Copy link
Member

shardros commented Nov 7, 2021

I have created a PR with one possible solution. Less hacking than globals, I still feel like there is a more pythonic way out there but idk what it is.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants