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

Extraneous bus.read_byte commands? #169

Open
joemarshall opened this issue Nov 17, 2015 · 1 comment
Open

Extraneous bus.read_byte commands? #169

joemarshall opened this issue Nov 17, 2015 · 1 comment

Comments

@joemarshall
Copy link
Contributor

In various functions in grovepi.py, there are what seem to me to be completely extraneous calls to read_byte, which can just be deleted. Or at least, deleting them doesn't seem to break anything for me.

e.g. in analogRead it says bus.read_byte(address), then it does the actual read transaction with number = bus.read_i2c_block_data(address, 1). As far as I can tell the bus.read_byte is totally ignored, just does an extra i2c transaction for no reason and makes the code slightly slower.

Maybe I'm missing something and there is a reason for it, but as far as I can tell this is a bug?

@karan259
Copy link
Contributor

When we were building the firmware initially, we found that read_block() didn't work properly without calling the read_byte() first and this was the way we were able to make it work. It was a workaround then and we seem to have kept it till now.

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

3 participants