Skip to content

Conversation

basilfx
Copy link
Member

@basilfx basilfx commented May 27, 2018

Contribution description

This PR updates the BMx280 driver. Tested this one on the SLTB001A (EFM32, adapted).

It's probably better to wait for #8383, but it was easy to adapt for the time being.

Issues/PRs references

#6577

@basilfx basilfx added the TF: I2C Marks issues and PRs related to the work of the I²C rework task force label May 27, 2018
@basilfx basilfx requested a review from dylad May 27, 2018 20:44
@aabadie aabadie added the Area: drivers Area: Device drivers label Jun 3, 2018
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

Needs an update to latest API.

Otherwise I tested this PR with #9198 on an Arduino Zero board and it works.

result = i2c_read_regs(dev->params.i2c_dev, dev->params.i2c_addr, offset,
buffer, nr_bytes_to_read, 0);
i2c_release(dev->params.i2c_dev);
if (result != I2C_ACK) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I2C_ACK 'return code was removed from the API, prefer a check like != or <0.

result = i2c_read_regs(dev->params.i2c_dev, dev->params.i2c_addr,
offset, measurement_regs, nr_bytes_to_read, 0);
i2c_release(dev->params.i2c_dev);
if (result != I2C_ACK) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

@keestux
Copy link
Contributor

keestux commented Jun 9, 2018

@basilfx can you rebase onto the latest new_i2c_if?

@basilfx basilfx force-pushed the feature/i2c_drivers_bmx280 branch from 77e3618 to ec65df2 Compare June 17, 2018 08:50
@basilfx
Copy link
Member Author

basilfx commented Jun 17, 2018

Sorry for the delay. I have rebased and adapted, but I cannot test this one since I have to fix EFM32 first (which will take some time).

@keestux
Copy link
Contributor

keestux commented Jun 17, 2018

Thanks
I've tested it with SODAQ Autonomo, and I confirm it is working

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 a bit puzzled because sometimes return codes are used and rest of the time you used (void) function and you're returning other data.
As I know, the coding lines did not say anything about that but this is a bit inconsistent from my point of view.
@aabadie what do you think ?

@basilfx
Copy link
Member Author

basilfx commented Jun 17, 2018

@dylad Can you tell me which lines? Note that I only adapted this driver to make it work with the new interface, so most code was already in place.

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.

Note that I only adapted this driver to make it work with the new interface, so most code was already in place.

@basilfx You're right, the aim of the refactoring is only to adapt the current driver.
Since @keestux successfully tested this PR, I guess we can go :)
I give you my ACK !

@basilfx basilfx force-pushed the feature/i2c_drivers_bmx280 branch from ec65df2 to 1393890 Compare June 18, 2018 17:15
@basilfx
Copy link
Member Author

basilfx commented Jun 18, 2018

Squashed.

@dylad
Copy link
Member

dylad commented Jun 18, 2018

@aabadie Can we dismiss your review ?

Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

My requested changes were addressed.

ACK and go

@aabadie aabadie merged commit ac26342 into RIOT-OS:new_i2c_if Jun 19, 2018
basilfx pushed a commit to basilfx/RIOT that referenced this pull request Jul 10, 2018
dylad pushed a commit to dylad/RIOT that referenced this pull request Jul 10, 2018
dylad pushed a commit that referenced this pull request Jul 11, 2018
@basilfx basilfx deleted the feature/i2c_drivers_bmx280 branch January 14, 2020 22:03
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.

4 participants