ivanseidel / ivanseidel/ArduinoSensors
No need to wait after Wire.requestFrom().
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 57
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
In the file "HMC6352.h" there is a while-loop after the call to Wire.requestFrom() in three places. Those while loops can be removed. There is nothing to wait for.
When the Wire.requestFrom() returns, the I2C transaction has completely finished and the received data is waiting in a buffer in the Wire library.
The function "getAddressDumb()" is commented out, but it uses a while-loop with micros() for some kind of timeout. The call to micros() is not needed and the while-loop is not needed.
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 HMC6352.h by inspecting the three Wire.requestFrom() call sites and the commented-out getAddressDumb() function. Remove the specified waiting loops and unnecessary micros() call, then confirm that all affected code no longer waits after the completed I2C transaction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, cpp
- Domain
- embedded-iot
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100