drivers: bmx280: adapt to new I2C api.#9206
Conversation
drivers/bmx280/bmx280.c
Outdated
| 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) { |
There was a problem hiding this comment.
I2C_ACK 'return code was removed from the API, prefer a check like != or <0.
drivers/bmx280/bmx280.c
Outdated
| 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) { |
|
@basilfx can you rebase onto the latest new_i2c_if? |
77e3618 to
ec65df2
Compare
|
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). |
|
Thanks |
dylad
left a comment
There was a problem hiding this comment.
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 ?
|
@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. |
ec65df2 to
1393890
Compare
|
Squashed. |
|
@aabadie Can we dismiss your review ? |
aabadie
left a comment
There was a problem hiding this comment.
My requested changes were addressed.
ACK and go
drivers: bmx280: adapt to new I2C api.
drivers: bmx280: adapt to new I2C api.
drivers: bmx280: adapt to new I2C api.
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