ivanseidel / ivanseidel/ArduinoSensors

No need to wait after Wire.requestFrom().

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.