Extraneous bus.read_byte commands?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 494
- Forks
- 472
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in grovepi.py with analogRead and compare each bus.read_byte call with the following bus.read_i2c_block_data transaction. Check whether the calls are required by the GrovePi or I2C protocol, then inspect the other affected functions and exercise the relevant sensor reads. Done means unnecessary transactions are removed without changing sensor behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, raspberry-pi
- Domain
- embedded-iot, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100