Skip to content

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Jun 6, 2018

Contribution description

This PR readapts the lsm6dsl driver to the I2C return codes (< 0 in case of an error, 0 on success).

Issues/PRs references

Follow-up of #9193 and related to #6577

@aabadie aabadie added Area: drivers Area: Device drivers TF: I2C Marks issues and PRs related to the work of the I²C rework task force labels Jun 6, 2018
Copy link
Member

@dylad dylad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should change the behaviour of the driver.
Right now, the res variable in most functions is increment (res +=) at each I2C API call but now we don't return the number of bytes I think this should be dropped.
What do you think ?

@aabadie
Copy link
Contributor Author

aabadie commented Jun 7, 2018

What do you think ?

Each function is supposed to return 0 on success, so after adding all return codes, the result must be 0. If one of the function a negative error code, then the final result is negative as well, meaning there's an issue.
I'll check if the doxygen documentation is inline with that.

@aabadie aabadie merged commit b2782ee into RIOT-OS:new_i2c_if Jun 28, 2018
basilfx pushed a commit to basilfx/RIOT that referenced this pull request Jul 10, 2018
drivers/lsm6dsl: adapt the i2c api return codes
dylad pushed a commit to dylad/RIOT that referenced this pull request Jul 10, 2018
drivers/lsm6dsl: adapt the i2c api return codes
dylad pushed a commit that referenced this pull request Jul 11, 2018
drivers/lsm6dsl: adapt the i2c api return codes
@aabadie aabadie deleted the new_i2c_lsm6dsl branch August 31, 2018 07:05
@aabadie aabadie added this to the Release 2018.10 milestone Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers TF: I2C Marks issues and PRs related to the work of the I²C rework task force
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants